3 ms·
Volatile already has semantics that are both too strong and too weak to implement atomics. Reusing volatile for atomics was rejected very early during the memor
by gpderetta 3y ago
Volatile already has semantics that are both too strong and too weak to implement atomics. Reusing volatile for atomics was rejected very early during the memory model standardization process.
As an extension, MSVC did for a time add atomic and acquire/release semantics to volatile. This was deprecated because it broke too much stuff.
edit: after your edit, I'm not sure if you arguing for volatile-for-atomic or not.
- kazinator 3y agoWell, yes; it's painfully obvious that you won't obtain, say, an atomic increment or compare-swap out of any simple combination of volatile anything, and it's more harmful than good to even try.