[gclist] Finalization and object orientation.

Charles Fiterman cef@geodesic.com
Fri, 28 Mar 1997 12:04:12 -0600

>No, Hans is right, reachability as defined above is in general
>undecidable even in systems which don't allow forgery of object
>pointers.  Unreachability is semidecidable, which is what enables
>garbage collection to work, but reachability is not decidable. 
>A scan followed by a trace will only divide objects into definitely
>unreachable and possibly reachable.

While you can't guarantee running finalizers at the earliest possable
moment you can guarantee running them. At end of job you can sort
remaning finalizers in finalizer order number sequence and run them.
Approaching the earliest moment is a quality of implementation issue.

BTW: Another argument for saying that the finalizer order is purely
in the semantics of the mutator. Suppose you have a list of objects
with finalizers. Suppose each object refers to the next one but
requires a post finalized version. 

The assumption that the post finalized version of an object must be
less useful is a bogus one inherited from C++ which smashes the vtable
pointer. The post finalized version could contain added value.

Charles Fiterman		Geodesic Systems
414 North Orleans Suite 410	Phone 312 832 1221 x223
Chicago IL 60610-4418		FAX   312 832 1230

A computer language without garbage collection
  is like a city without garbage collection.