[gclist] Buffy finalizer slayer.
Mon, 14 Jun 1999 06:48:53 -0500
At 11:27 PM 6/11/99 -0700, you wrote:
>On Jun 11, 1:58pm, Charles Fiterman wrote:
>> Why would I turn the watcher into a finalizable object?
>The point was that you could do essentially the same thing with topologically
>ordered finalization, and vice-versa. Thus the difference between watcher
>objects and finalizers is largely one of terminology and cosmetics. In
>case the collector communicates some facts about reachability back to the
>mutator, and that's all it does.
First topological reachability can be partially evaluated at class
definition time. That is when I design a class I know what it will require
to finalize. This allows turning n*n*n topological sorts into n*log(n)
qsorts or even non sorts which are the most common case.
Second topological sorting may not be what the user wants. When we open the
door by allowing him to order things he may want antoher order.
>> The point is to
>> eliminate finalizers from the system as an active danger.
>I'm arguing that they're no more or less dangerous than watcher objects.
>> What happens at end of job?
>In my view nothing special. You DON'T run finalizers. It's not safe to. If
>you need to guarantee that something is run before job exit you need another
>mechanism. Ditto for watcher objects, since some of these objects will still
But you have that mechanism. The watcher objects, triggered or untriggered
are on a list where the user can see them and make decisions. Finalizers
can't be on such a list or they wouldn't finalize.