[gclist] Guardians

Charles Fiterman cef@geodesic.com
Thu, 10 Apr 1997 11:41:02 -0500


>I'll advance a hypothesis:  Finalizers (or weak references or any other 
>mechanisms of this general sort) are appropriate for improving performance 
>(e.g., getting rid of local proxies for no-longer-locally-accessed remote 
>objects); they are *in*appropriate for ensuring correctness.  This hypothesis 
>shouldn't seem as radical as it looks:  After all, *GC itself* was development 
>as a mechanism for improving performance, *not* for providing correctness.  If 
>the abstraction that GC provides is "infinite memory", then the null GC, 
>together with enough (for the program at hand) real memory, should work just as 
>well!

I call this the inherint sinfulness of finalizers argument. Let me put it
more simply. 

The function of a garbage collector is to remove objects when they can no
longer influence the order of execution. Finalizers influence the order
of execution or they wouldn't exist. So the collector discovers that an
object can no longer influence the order of execution and then uses it
to do exactly what it cannot do.

The most correct thing may be not to have finalizers. But having sined let
us sin big let us take full advantage of this powerful tool.
			-  
Charles Fiterman		Geodesic Systems
414 North Orleans Suite 410	Phone 312 832 1221 x223
Chicago IL 60610-4418		FAX   312 832 1230
				http://www.geodesic.com

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