Reordering in a Java memory model

re-read JMM , find one sentence that I don't understand:

We consider here only variables that can be read and written as an atomic unit - that is, no bit fields, uneven accesses or accesses larger than the word sizes available on the platform.

Anyone can explain the cases shown above, which are in bold.

+4
source share
1 answer

On some architectures, the processor can execute several memory accesses in one command:

  • : ; read-modify-write, .
  • : , , . , , ; 0x01 0x05, 0x01-0x04 0x05. , ; , , 3 , ( 4). ( , , ).

, , , .

+2

Source: https://habr.com/ru/post/1538366/


All Articles