[concurrency-interest] DirectByteBuffers and reachabilityFence
davidcholmes at aapt.net.au
Wed Dec 9 17:55:41 EST 2015
Justin Sampson writes:
> David Holmes wrote:
> > You are still assuming/expecting that happens-before enforces
> > temporal ordering - it doesn't.
> > If two actions are temporally ordered: A occurs before B; and the
> > spec says there is a happens-before edge between A and B, then you
> > know what B can expect to see with respect to A's actions. Nothing
> > more, nothing less.
> I didn't say anything about temporal ordering, so I'm not sure what
> you're saying can happen. Forget about synchronization actions and
> just think about reads and writes. Since the completion of the
> constructor happens-before the execution of the finalizer, all
> reads and writes in the constructor happen-before all reads and
> writes in the finalizer, because happens-before is transitive and
> program order implies happens-before order. What kind of execution
> are you imagining that might be problematic?
I think we may just be at cross purposes. All I'm saying is that the
existence of a happens-before edge does not imply any kind of temporal
ordering. So just because it is specified that completion of the constructor
happens-before execution of the finalizer (so the finalizer thread will see
writes from the constructor) it doesn't imply that the finalizer is not
permitted to execute until the constructor has completed. If the finalizer
runs concurrently with the constructor then the constructor may well see the
actions of the finalize method.
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
More information about the Concurrency-interest