2 ms·
I wondered about 'volatile'. Its not really meant for that - but maybe its enough to trigger 'hands off'.
by JoeAltmaier 12y ago
I wondered about 'volatile'. Its not really meant for that - but maybe its enough to trigger 'hands off'.
- fragmede 12y agoPractically speaking, 'volatile' has used for that pretty much since its inception.
- TheLoneWolfling 12y agoYep, even though it really shouldn't be. Volatile has... problems. It was meant more for mem-mapped IO than thread safety. And it's too powerful at the same time, as in there are a number of optimizations that are safe in the typical use cases of volatile that cannot be done to volatile variables.