On Wed, 9 Sep 2020 13:04:38 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:

>> Updated PR.
>
> Now I wonder (after reading the discussion), why not 
> `UNSAFE.storeStoreFence()`? I am basically okay with either, given
> they currently map to the same thing. But it seems that semantically only 
> `storeStoreFence` is really needed here.

Scratch that. Hotspot does `MemBar_Release` for final stores, low-level Java 
code is better do the same:
 
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/parse1.cpp#L1005

It deserves a separate follow-up to homogenize the uses of 
`Unsafe.storeStoreFence` and `Unsafe.storeFence` in other
places in JDK.

-------------

PR: https://git.openjdk.java.net/jdk/pull/94

Reply via email to