[jmm-dev] jdk9 APIs [Fences specifically]

Doug Lea dl at cs.oswego.edu
Fri Aug 14 13:35:40 UTC 2015


On 08/13/2015 05:04 PM, Hans Boehm wrote:

>  >> I know of no hardware instructions, except on SPARC, that correspond
>  >> to a LoadLoad fence.  And my impression is that it's not very useful on
>  >> SPARC.  The ARM DMB xLD fence instruction, if I understand correctly,
>  >> is essentially a C++ acquire fence.
>  >
>  >
>  > But I think that pseudo-fences (load; compare to self; ...) need not be?
> Those are fundamentally LoadStore fences.  On Power you can also turn
> them into a LoadLoad fence by adding an isync.  I think the ARM situation
> is essentially identical.

On a little more checking, I think so too.
(Formal validation would be nice...)
But even if so, it seems better to have a uniform API:
   writes:  full > release > storeStore
   reads:   full > acquire > loadLoad
even if loadLoad is internally mapped to acquire.
And omitting it feels even more wrong if we support
RCU-like usages with scoped loadLoadFence(Object ref).

-Doug




More information about the jmm-dev mailing list