Volatile vs Lock vs Interlocked in C# .Net
If you have worked in multi-threaded programs, you may have encountered these keywords – volatile, lock and Interlocked. But if you do not really understand what is the difference between these or which one is to be used when, this article might help. Let us consider a scenario first. Let’s say there is an integer …