Volatile Worthless or Not

Dmitriy Vyukov
Total Points:
25,462
Status Points:
25,462
Black Belt
July 9, 2009 6:57 AM PDT
Rate
 
#1
Quoting - chris
Over at this blog, Arch Robinson claimed that volatile is almost worthless for multithreaded programming.  I, Chris, argue that volatile is necessary in order for memory fences to work with lock free programming.  Can anyone clarify this?

http://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/

Arch is referring to ISO C++'s volatile which has nothing to do with multi-threading, memory fences and lock-free programming.
And you are probably referring to Microsoft Visual C++'s volatile which is basically promoted to the rank of multi-threading synchronization primitive.



Intel Software Network Forums Statistics

8487 users have contributed to 31622 threads and 100698 posts to date.
In the past 24 hours, we have 35 new thread(s) 121 new posts(s), and 186 new user(s).

In the past 3 days, the most popular thread for everyone has been gemm(A,A,A) like possible? The most posts were made to gemm(A,A,A) like possible? The post with the most views is Dear Steve, excuse me for a d

Please welcome our newest member chat1983