I'm just wondering if anyone can explain the meaning of this:
Operations such as increment and decrement (for example, ++and --) cannot be used for a volatile variable, because these operations are syntactic sugar for loading, modifying and storing.
I think increment and decrement should work just fine for a volatile variable, the only difference would be each time you read or write, you will access from / write to main memory, not from cache.
Abidi source
share