[jmm-dev] Specifying VarHandle acquire/release without ill effects

Martin Buchholz martinrb at google.com
Mon Jun 27 23:50:39 UTC 2016


(I'm not qualified to revise the memory model, but I can handwave ...)

On Sat, Jun 25, 2016 at 12:48 AM, Hans Boehm <boehm at acm.org> wrote:

> I think C++'s definitions of acquire/release, as refined by the work by
> Mark Batty et al, are in pretty good shape.  But I strongly suspect they
> are incompatible with Java's notion of a total synchronization order.


https://docs.oracle.com/javase/specs/jls/se8/html/jls-17.html#jls-17.4.6
Current memory model has:

- synchronization order, which is a total order over all synchronization
actions
- synchronizes-with, a partial order over synchronization actions
- happens-before, a partial order over actions

and (hand-waving) "all we need to do" is allow synchronizes-with to also
apply to actions that are not synchronization actions (acquires and
releases)


More information about the jmm-dev mailing list