2 ms·
Java only requires that the writes can't be seen out of order - if a thread writes A then B, another thread can't read the new value of B and then the old value
by twic 10y ago
Java only requires that the writes can't be seen out of order - if a thread writes A then B, another thread can't read the new value of B and then the old value of A. If coalescing them makes them all happen atomically, that's fine.