[gclist] Finalization and the insane postman bug.
Thu, 04 Oct 2001 16:05:36 -0500
At 01:53 PM 10/4/01 -0700, you wrote:
>I think it actually doesn't make much of a difference.
The difference is that the extent to which objects rise from the dead is
under user control one way and not the other.
Its easy for the user to get the effect of finalizers via some sort of meta
object protocol. But the nature of the protocol belongs in the hands of the
user not the collector.
>Let's say you want to be notified of object A's unreachability. The
>language provides for finalization, but you would rather see this sort of
>"death notice" delivered to B. No problem. Simply add a pointer from A to
>B and make B finalizable instead.
>You can also almost go the other way. If you want a finalizer for A, but
>the language gives you some form of "death notice", you move all the
>interesting data that was in A into a separate object C referenced from A,
>and you also give the object to be notified of the death a reference to C.
>I think neither model either solves or creates any significant problems
>relative to the other. In either case the collector communicates
>reachability information back to the user, and that's all it does. A
>finalizable object doesn't rise from the dead; a finalizable object is
>refrenced by a data structure private to the collector; it is notified when
>it's reachable only from that data structure.