[gclist] Destructor FAQ

David Chase chase@centerline.com
Fri, 15 Mar 96 12:10:42 EST


One thing I haven't seen (perhaps I haven't been paying attention 
-- it's been a busy week) is some mention of the OTHER mechanisms 
in these languages (Java, Modula-3, Lisp) for "finalization".  You
don't have to do it all with objects -- if the lifetime of the resource 
corresponds with the lifetime of some lexical scope, you can say

  TRY
  ...
  FINALLY
  ...
  
and get guaranteed reclamation of that resource.  Note that Modula-3 
and Java have threads as well -- there can be multiple threads of 
control, with multiple stacks of things-to-be-finalized, simultaneously 
in existence.  If it gunks up garbage collection to much to get 
absolutely-positively-guaranteed-and-prompt finalization, then maybe
that sort of finalization should be dealt with in some other way.

David Chase