Why is the volatile qualifier used through out std::atomic?

Posted by Caspin on Stack Overflow See other posts from Stack Overflow or by Caspin
Published on 2010-03-19T16:52:59Z Indexed on 2010/03/19 17:21 UTC
Read the original article Hit count: 412

Filed under:
|
|
|

From what I've read from Herb Sutter and others you would think that volatile and concurrent programming were completely orthogonal concepts, at least as far as C/C++ are concerned.

However, in GCC c++0x extension all of std::atomic's member functions have the volatile qualifier. The same is true in Anthony Williams's implementation of std::atomic.

So what's deal, do my atomic<> variables need be volatile or not?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c++0x