RE: JavaMemoryModel: finalization review

From: Jerry Schwarz (jerry.schwarz@oracle.com)
Date: Mon Nov 24 2003 - 16:25:18 EST


At 12:42 PM 11/24/2003, Bill Pugh wrote:

>>and the finalizer only needs to synchronize on impls. I'm perfectly
>>happy with
>>that. But it's clearly not backward compatible with existing VMs, and
>>hence would need
>>to be an addition to the current reachability rules, not a
>>replacement. (I suspect that
>>adding a method to Object is not really feasible, so you would really
>>have to say
>>something like System.reachable(this), but I'm not sure I understand all
>>the issues
>>there.)
>
>
>Of the syntax/api changes suggested on the list recently, I think this is
>the only one that might be doable at this late state, perhaps along with
>removing spurious wakeups from wait.
>
>I'm not sure I like reachable as a name, since it is so tightly tied to
>finalization. How about
> System.doNotFinalizeYet(Object o)
>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).

I would prefer

      System.unmovableReference(Object o)

The significant fact about this method is not that it designates a point at
which the object is reachable or unfinalizable. Any reference does that.
The significant aspect of it is that compilers aren't allowed to move it
around or eliminate it. (Well, they're allowed to eliminate it.

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

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



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