Quantcast
Channel: Is volatile a proper way to make a single byte atomic in C/C++? - Stack Overflow
Viewing all articles
Browse latest Browse all 6

Is volatile a proper way to make a single byte atomic in C/C++?

$
0
0

I know that volatile does not enforce atomicity on int for example, but does it if you access a single byte? The semantics require that writes and reads are always from memory if I remember correctly.

Or in other words: Do CPUs read and write bytes always atomically?


Viewing all articles
Browse latest Browse all 6

Trending Articles



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