[concurrency-interest] Object finalization

Vitaly Davidovich vitalyd at gmail.com
Sun May 13 18:19:46 EDT 2012

perhaps I'm misremembering but there's no guarantee on the order in which
objects are reclaimed.  When SomeService finalizer runs and assuming a and
b were kept alive only by this instance of SomeService, I don't think
there's any guarantee that a and b have not been reclaimed at this point
already.  That's how the CLR finalization works, so perhaps I'm conflating
the two.

Sent from my phone
On May 13, 2012 5:54 PM, "Bob Lee" <crazybob at crazybob.org> wrote:

> On Sun, May 13, 2012 at 2:41 PM, Vitaly Davidovich <vitalyd at gmail.com>wrote:
>> I am unclear whether the original question is specifically about
>> reachability of a and b from the constructor or whether the constructor was
>> shown to us to indicate that a and b are never null after construction
>> (assuming asserts are enabled).  If it's the former, your answer is correct
>> (that's what I meant by saying not sure if your reply was answering the
>> question).  If it's the latter, then I'm pretty sure my response is correct
> Again, according the JLS, you're incorrect. "a" and "b" will be non-null
> when SomeService.finalize() executes. Why would you think otherwise?
> Bob
> Square is hiring! <https://squareup.com/jobs>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20120513/e8261291/attachment-0001.html>

More information about the Concurrency-interest mailing list