In jls-17.7 it is mentioned:
... a single write to a non-volatile long or double value is treated as two separate writes: one to each 32-bit half...
And then it says,
Writes to and reads of references are always atomic, regardless of whether they are implemented as 32-bit or 64-bit values.
I want to understand what this second paragraph means. It is confusing me because in the first paragraph, it is mentioned that a write to long and doubles are treated as two separate writes, and in this quote they are contradicting it.
Please note that I have already read this but this doesn't answer the explanation I am looking for.
UPDATE: I received a comment - "references are not longs or doubles, they are treated differently, so there is no contradiction"...
That's what is confusing me, we do operation using references only, right? For example: long l1 = 88;
. Then what's the meaning of that line.