By mswatcher
via brooker.co.za
Submitted: Nov 19 2012 / 03:32
It's well known that volatile in Java doesn't mean the same thing as atomic. As Jeremy Manson says: If you do an increment of a volatile integer, you are actually performing three separate operations: 1) Read the integer to a local. 2) Increment the local 3) Write the integer back out to the volatile field.
Add your comment