RFR: JDK-8074578 Document memory visibility effects of some Unsafe methods

Martin Buchholz martinrb at google.com
Tue Mar 10 05:04:24 UTC 2015


??
I mentally map Java volatile operations to C11 seq_cst because of the total
order over all operations on volatile variables.
Volatile reads and writes do not just have acquire/release semantics.
The java memory model does not (yet) have C11-style relaxed atomics (like
acquire or release)

On Mon, Mar 9, 2015 at 6:38 PM, David Holmes <david.holmes at oracle.com>
wrote:

> PS. You state: "Corresponds to C11 atomic_compare_exchange_strong." Yet
> that would match with the full bi-directional fences of the VM
> implementation (due to memory_order_seq_cst), not a volatile read followed
> by a volatile write (which would be memory_order_acq_rel).
>



More information about the core-libs-dev mailing list