[concurrency-interest] Question about "happens-before"
Pete.Soper at Sun.COM
Fri May 19 12:57:44 EDT 2006
Thomas Hawtin wrote:
> Pete Soper wrote:
>> This seemed quite clear the first time. More fundamentally, if the
>> constructor never completes, the finalizer's running is impossible,
> JLS 3 states that the finaliser may (because it never must) run if the
> Object constructor exited normally. 1.6 complies with this (apparently
> even if instrumentation rewrites the Object constructor).
> I believe earlier editions of the JLS are silent on this. 1.5 (and I
> presumably earlier versions) will call the finaliser on any object that
> has been allocated. Possibly not even calling the derived most
> constructor. IIRC, javac produced byte code does the new, dups the
> uninitialised reference, evaluates the arguments, then calls the
> <init>(...)V, so even if the arguments are not fully evaluated the
> finaliser is called.
This is a dupe of 5092933 which I'm happy to say was fixed in build 59
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.
> Tom Hawtin
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
More information about the Concurrency-interest