Quantcast
Channel: Are volatile reads and writes atomic on Windows+VisualC? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Answer by Tobias Schlegel for Are volatile reads and writes atomic on Windows+VisualC?

$
0
0

As of Visual C++ 2005 volatile variables are atomic. But this only applies to this specific class of compilers and to x86/AMD64 platforms. PowerPC for example may reorder memory reads/writes and would require read/write barriers. I'm not familar what the semantics are for gcc-class compilers, but in any case using volatile for atomics is not very portable.

reference, see first remark "Microsoft Specific": http://msdn.microsoft.com/en-us/library/12a04hfd%28VS.80%29.aspx


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>