Re: JavaMemoryModel: Finalization idioms

From: Bob Lee (crazyboblee@gmail.com)
Date: Sun May 01 2005 - 12:00:24 EDT


What if the object created a static weak reference to itself in the
constructor, and then nulled the weak reference in the finalizer? This
would remove the need to do something in every method of the object,
but the performance penalty would probably be higher (i.e. if you
stored the weak references in a set or something).

Bob

On 5/1/05, David Holmes <dholmes@dltech.com.au> wrote:
> My understanding of this issue is that the client code - that which is
> referencing the object - must do something to ensure the object remains
> reachable, but following some protocol involving the finalize method of the
> object concerned.

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



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