The specified instruction bytecodes ( iinc , iload , aload , etc.) work with values ββfrom the operand stack and local variables. These regions are local in the flow (see JVMS 2.5 , 2.6 ), i.e. speaking of atomicity is pointless here. That is, they are NOT implemented using atomic processor instructions such as lock xadd , but no one should care.
Bytecode commands that read or write fields and array elements ( getfield , putfiled , iastore , etc.) are atomic, except for long and double types (see JLS 17.7 ). A 32-bit JVM can implement (in fact, the JSM HotSpot implements) read and write 64-bit fields with two 32-bit loads or storages, unless the field is declared volatile .
apangin
source share