Click here to Skip to main content
15,890,741 members
Articles / Programming Languages / C#

Why You Should Use the volatile Keyword with the Double Check Lock Pattern

Rate me:
Please Sign up or sign in to vote.
4.49/5 (19 votes)
27 Apr 2023CPOL5 min read 36.2K   27  
Why use volatile keyword with double check lock pattern
This tip discusses the reason why volatile keywork is used with double check lock pattern.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Languages/frameworks: C#, .NET, ASP.NET, C/C++, WPF
Experienced in Web development, UI development, frameworks and multi-threading.


Author of the book Essential Software Development Career + Technical Guide.
https://www.amazon.com/dp/B0BXHYWMDP/

Check out our website at:
https://essentialsoftwaredevelopment.com/

Comments and Discussions