Duplicate :
|
The JLS section 17.4 describes that doubles and longs may be observed to be assigned as two 32 bit pieces, except if the variable in question is volatile. The VM does not align data items and use single instructions to make sure that assignments to volatile variables are atomic. Ideally, all such assignments could be atomic, not just variables declared volatile. Such a VM would pave the way for eventual removal of section 17.4, which is a canker on the language.
|