Difference between Interlocked.Exchange and Volatile.Write?
the Interlocked.Exchange uses a processor instruction that guarantees an atomic operation. The Volatile.Write does the same but it also includes a memory barrier operation. I think Microsoft added Volatile.Write on DotNet 4.5 due to support of ARM processors on Windows 8. Intel and ARM processors differs on memory operation reordering. On Intel, you have a … Read more