Quantcast
Channel: Volatile vs. Interlocked vs. lock - Stack Overflow
Viewing all articles
Browse latest Browse all 11

Answer by HeSansi for Volatile vs. Interlocked vs. lock

$
0
0

I'm just here to point out the mistake about volatile in Orion Edwards' answer.

He said:

"If it is volatile, this just ensures the two CPUs see the same data atthe same time."

It's wrong. In microsoft' doc about volatile, mentioned:

"On a multiprocessor system, a volatile read operation does notguarantee to obtain the latest value written to that memory locationby any processor. Similarly, a volatile write operation does notguarantee that the value written would be immediately visible to otherprocessors."


Viewing all articles
Browse latest Browse all 11

Trending Articles



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