URL details: yizhang82.dev/atomic-vs-volatile-x86

URL title: std::atomic vs volatile, disassembled | yizhang82’s blog
URL description: This came up during a code review and the code was using volatile to ensure the access to the pointer variable is atomic and serialized, and we were sort of debating whether it is sufficient, in particular: Is it safer to switch to std::atomic<T>, and if so, why? Is volatile sufficiently safe for a strong memory model CPU like x86? Most of us can probably agree that std::atomic<T> would be safer, but we need to dig a bit deeper to see why is it safer, and even for x86.
URL last crawled: 2022-07-07
URL speed: 0.192 MB/s, downloaded in 0.300 seconds

open external url

We found no external links pointing to this url.