[concurrency-interest] DirectByteBuffers and reachabilityFence

Vitaly Davidovich vitalyd at gmail.com
Wed Dec 9 21:32:33 EST 2015

I've seen happens-before defined as writes happen before reads and say
nothing about reads before writes or reads before reads.  All I'm saying is
that full clarity is warranted so we don't need to have debates like this.

sent from my phone
On Dec 9, 2015 9:24 PM, "Justin Sampson" <jsampson at guidewire.com> wrote:
> Vitaly Davidovich wrote:
> > The sane and intuitive thing is to say all reads/writes in ctor
> > happen-before all reads/writes in finalizer. That just about
> > enforces the temporal aspect but is also the model that all
> > developers would intuit.
> That's exactly what the JLS says! Twice! It's central to the very
> definition of the happens-before ordering that the completion of a
> constructor happens-before the execution of a finalizer on the same
> object. That means _nothing but_ the fact that all reads and writes
> in the constructor happen-before all reads and writes in the
> finalizer. It doesn't say "_if_ the finalizer _doesn't_ execute
> concurrently with the constructor..." -- that would be meaningless,
> because the whole point of defining the happens-before ordering is
> to define the semantics of "concurrently." If one program action
> happens-before another, then they are by definition _not_ concurrent
> actions. Therefore the JLS explicitly states that no finalizer may
> ever be executed concurrently with any constructor for the same
> object. If by "temporal ordering" David means the order of actual
> instructions on a physical processor, that's an implementation
> detail -- all the JLS has to say is that the physical operation of
> the program must behave _as if_ all of the above is true. If a JVM
> does _not_ behave as if all of the above is true, then it is not
> implementing the JLS correctly.
> Cheers,
> Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20151209/d0950ee2/attachment.html>

More information about the Concurrency-interest mailing list