Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cwjcc!gatech!hubcap!billwolf%hazel.cs.clemson.edu
From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 )
Newsgroups: comp.sw.components
Subject: Re:  Re: Garbage Collection & ADTs
Message-ID: <6589@hubcap.clemson.edu>
Date: 26 Sep 89 18:25:30 GMT
References: <911@scaup.cl.cam.ac.uk>
Sender: news@hubcap.clemson.edu
Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu
Lines: 40

From scc@cl.cam.ac.uk (Stephen Crawley):
> Here are some problems where programmer-controlled storage management 
> would be very difficult or impossible.
> 
>   Interactive editting of cyclic graph data structures.  You have a 
>   heterogeneous cyclic graph data structure and the editor must be able
>   to make arbitrary sequences of changes to the data structure.  How
>   do you detect that a subgraph has become detached?   

   The fact that a subgraph has become detached does not imply that
   it is no longer part of a graph.  Not all graphs are fully connected.
   Therefore, it isn't possible to release the storage used until there
   is some sort of directive which indicates that a given set of nodes
   and/or arcs is to be destroyed. 

>   Dynamic loading & unloading of modules in a running program.  
>   [...] the dynamic loader needs to know if the module is
>   currently being 'used' ... e.g. if some thread is executing a 
>   procedure exported by the module or if some other part of the
>   application has salted away a reference into the module (e.g. a 
>   procedure pointer)
> 
> This problem arose when I was using Mesa / XDE to implement my entity system;
> a persistent object system.  I did get the dynamic loading to work ... and 
> it made a big performance difference, but dynamic unloading could not be 
> done safely, since the Mesa / XDE environment has no garbage collector.

   This is an operating-system problem, not an application problem.
   As such, the situation is not "applicable to a wide range of
   applications".  The solution is operating-system dependent; one
   approach might be to use idle time to scan the processes in the
   process queue to determine if there are any processes which were
   started while the old module was in effect which made use of it.

   Operating systems do a lot of things (pointer arithmetic, etc.)
   which application systems should not be doing; this falls into
   exactly that category.


   Bill Wolfe, wtwolfe@hubcap.clemson.edu