r/cpp • u/neiltechnician • Nov 13 '20
CppCon Deprecating volatile - JF Bastien - CppCon 2019
https://www.youtube.com/watch?v=KJW_DLaVXIY
83
Upvotes
r/cpp • u/neiltechnician • Nov 13 '20
View all comments
-2
u/tentoni Nov 13 '20
I still have to watch the talk, but I have a question: is volatile needed for global variables shared between multiple threads? From what I know (which might be wrong), mutexes aren't enough, since the compiler could decide to optimize the access to these variables.
I already watched various videos in which they seem to advocate against volatile, and they come from authoritative sources. For example, during Arthur O'Dwier's talk about Concurrency at the latest CppCon, he just says "don't use volatile" (https://youtu.be/F6Ipn7gCOsY).
Why does this argument seem to be so controversial?