logoalt Hacker News

mananaysiempretoday at 10:05 AM1 replyview on HN

Not from the standard’s point of view. The traditional (in some circles) use of volatile for atomic variables was not sanctioned by the C11/C++11 thread model; if you want an atomic, write atomic, not volatile, or be aware of your dependency on a compiler (like MSVC) that explicitly amends the language definition so as to allow cross-thread access to volatile variables.


Replies

sethevtoday at 10:11 AM

Thread was a poor choice of word. Outside the control of the program is a better way to put it. Like memory mapped io.