[concurrency-interest] Question about "happens-before" andreordering

Jeremy Manson jmanson at cs.purdue.edu
Fri May 19 13:14:40 EDT 2006

Pete Soper wrote:

>   JLS 17.4.5 says the edge is from the end of the constructor, which 
> presumably can't be reached if an exception is thrown or the thread 
> stops making progress through the constructor. If a more tricky 
> definition of "end" is being used, then I shouldn't be surprised, but 
> will be anyway.

The section on finalization to which 17.4.5 points clarifies this to 
mean that the constructor's "completion" happens-before the finalize 
method.  In the context of the JLS, "completion" means completion via 
normal means or via exceptional (also called abrupt) means.

So "end" here means via an exception, as well.  We probably should have 
used the word "completion" in 17.4.5 to make it clearer.

OTOH, if the thread hangs, then completion is never reached, as you 
point out.


More information about the Concurrency-interest mailing list