Re: JavaMemoryModel: finalization review

From: Jeremy Manson (
Date: Mon Nov 24 2003 - 17:57:55 EST

[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Bill Pugh writes:
> > The semantics would be as mentioned before (a volatile write to
> > a hidden field of the object that is read before finalization of the
> > object).
> Would this increase the size of all objects by 4 bytes? (If so, this seems
> like a lot of memory to invest in something that is so seldom used.)

It would probably be more of a conceptual volatile field than a real one;
it would just be there to enforce the happens-before relationship (and
keep the object alive). Thus, you could implement it by simply not
performing an early invocation of an object's finalizer, and making sure
that appropriate memory barriers are performed in the correct places.

JavaMemoryModel mailing list -

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