Path: utzoo!attcan!uunet!mcsun!ukc!cam-cl!scc
From: scc@cl.cam.ac.uk (Stephen Crawley)
Newsgroups: comp.sw.components
Subject: Re:  Re: Component with garbage collection
Message-ID: <919@scaup.cl.cam.ac.uk>
Date: 27 Sep 89 11:31:37 GMT
References: <130200012@p.cs.uiuc.edu> <6600@hubcap.clemson.edu>
Sender: news@cl.cam.ac.uk
Organization: U of Cambridge Comp Lab, UK
Lines: 48

Bill Wolfe writes:
> Obviously, for any problem which either is the general GC problem or
> is analytically equivalent, GC algorithms can be used.

.. GC algorithms MUST be used.

> Maybe there are even a fair number of situations in which this is the case. 

Indeed there are!

Furthermore, there are a fair number of other situations where the problem
is not analytically equivalent to the general GC problem, BUT a GC solution
is the most efficient solution anyway. 

> If so, then GC is worth keeping around.

[Shock horror!]

> In these cases in which the ADT implementor doesn't have any useful 
> information to communicate to the storage management system; the GC 
> system can still raise an exception if it can't find any more space.  

I'm not sure what you are getting at here.  There is the obvious point
that any dynamic storage management system can completely run out of 
space, be it a GC'ed on a non-GC'ed system.  However, I've argued before 
that a non-GC'ed system is likely to get into this state sooner than
a GC'ed system:

  o If the non-GC'ed solution needs to be implemented using reference 
    counts, there is a 1 word overhead for each ref counted object.
    
  o Objects are likely to be explicitly freed later in the non-GC'ed 
    case than they become inaccessible in a GC'ed case.  [Admittedly,
    this argument assumes a degree of intelligence on the part of the
    compiler in the GC'ed case]

> Also, the implementor can still do a managed version if variable 
> response time is a problem.

Alternatively use a real-time garbage collector.

> In general, though, it still seems more efficient to communicate any
> information regarding the availability of storage which might be known
> by the ADT implementor, so that the work of searching for garbage can
> be concentrated on those situations in which it cannot be avoided. 

Alternatively let a smart compiler optimise the storage reclamation.
At least that way we know that the program will work.