Re: JavaMemoryModel: A problematical case for finalizers

From: Joshua Bloch (
Date: Tue May 20 2003 - 15:04:13 EDT


   No worries. I didn't think that you were referring to my book:) I
agree that there's lots of very bad advice floating around out there
concerning finalizers. But I simply wouldn't go out of my way to make
it any easier to write corect finalizers. Very few people should have
to write them, and those who do should understand the issues.

>5) There's no clear convention about the context in which finalizers
can be
>explicitly invoked. If System.runFinalization() runs finalizers in
the calling
It can't! One of the few hard guarantees is that finalizers are run
from a thread that holds no user-visible locks. (I say this from
memory, but I'm quite sure it's in the spec.)



JavaMemoryModel mailing list -

This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:44 EDT