Java's Atomic and volatile, under the hood on x86

from blog Marc Brooker's Blog, | ↗ original
Java’s Atomic and volatile, under the hood on x86 How exactly do AtomicInteger and volatile do their magic in Java? 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...