[concurrency-interest] DirectByteBuffers and reachabilityFence
jsampson at guidewire.com
Wed Dec 9 18:05:41 EST 2015
David Holmes wrote:
> If the finalizer runs concurrently with the constructor then the
> constructor may well see the actions of the finalize method.
Nope. For any read r inside the constructor and any write w inside
the finalizer, we know that hb(r, w), because hb(r, completion of
constructor) and hb(completion of constructor, execution of finalizer)
implies hb(r, execution of finalizer). But if r sees the value
written by w, then the execution is not happens-before consistent and
therefore it is not a well-formed execution according to the JMM.
More information about the Concurrency-interest