Value integrity guarantee for concurrent long writes in 64-bit OpenJDK 7/8

前端 未结 2 1466
广开言路
广开言路 2021-02-08 11:32

Note: this question isn\'t related to volatile, AtomicLong, or any perceived deficiency in the described use case.

The property I am trying to prove or rule out is as f

2条回答
  •  星月不相逢
    2021-02-08 12:25

    In fact, you've already answered your own question.

    There is no "non-atomic treatment" of double and long on 64-bit HotSpot JVM, because

    1. HotSpot uses 64-bit registers to store 64-bit values (x86_64.ad vs. x86_32.ad).
    2. HotSpot aligns 64-bit fields on 64-bit boundary (universe.inline.hpp)

提交回复
热议问题