The Java Language Specification allows 64-bit long
and double
values to be treated as two 32-bit values. For example, a 64-bit write operation could be performed as two separate 32-bit operations.
According to the _Java Language Specification_, §17§17.7, "Non-Atomic Treatment of {{ Wiki Markup double
}} and {{long
}}" \ [[JLS 2005|AA. References#JLS 05]\]:
This behavior is implementation specific; Java virtual machines are free to perform writes to
long
anddouble
values atomically or in two parts. For the purposes of the Java programming language memory model, a single write to a non-volatilelong
ordouble
value is treated as two separate writes: one to each 32-bit half. This can result in a situation where a thread sees the first 32 bits of a 64-bit value from one write, and the second 32 bits from another write.
...
Bibliography
...
[[Goetz 2006AA. References#Goetz 06] ] | 3.1.2, Non-atomic 64-Bit Operations | |||
]]></ac:plain-text-body></ac:structured-macro> | <ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="b142d907-6588-48cc-96d7-52ac31637924"><ac:plain-text-body><![CDATA [ [[Goetz 2004cAA. References#Goetz 04c]] |
| ]]></ac:plain-text-body></ac:structured-macro> | <ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e968b494-e399-453e-b30b-1a283acd836c"><ac:plain-text-body><![CDATA[ |
[[JLS 2005AA. References#JLS 05]] | §17.7, Non-atomic Treatment of double and long ]]></ac:plain-text-body></ac:structured-macro> |
...