3 ms·
Correct, but it’s worth noting that ‘volatile’ in Java does provide atomicity.
by nicoburns 5y ago
Correct, but it’s worth noting that ‘volatile’ in Java does provide atomicity.
- zozbot234 5y agoTrue, the guarantee of atomicity does come up in Java wrt. fields of type long or double, for which atomicity is not provided by the Java memory model in the absence of volatile. More to the point, volatile in Java provides linearizability which is a bit stronger than simple atomicity.
- ysleepy 5y ago*sequential consistency, not linerarizability