Article View: comp.lang.clos
Article #333Re: How to neatly destroy instances?
From: Barry Margolin
Date: Tue, 13 Oct 1992 23:23
Date: Tue, 13 Oct 1992 23:23
26 lines
1771 bytes
1771 bytes
In article <1490.719005371@bbn.com> jmorrill@BBN.COM writes:
>If you "let go" of an object in the sense of removing the last pointer
>to it, then couldn't the application "finalize" the object at that time?
>Why is it better to wait until the garbage collector gets around
>to cleaning up the bits?
The whole reason for automatic garbage collection is that it's difficult
for the application to know when it's removing the last pointer to an
object.
Here's an example where finalization may be useful: When programming the
Connection Machine in Lisp (either CM-Lisp or *Lisp) there are front-end
objects that act as handles to memory allocated on the CM; in *Lisp these
are called pvars (Parallel VARiables). Currently we require the program
either to explicitly create and destroy pvars, or create them with dynamic
extent (a la WITH-OPEN-FILE). We would like to support garbage collection
of pvars, but we need a hook into the garbage collector so that we know
when the CM memory has become available. Finalization would provide that
hook. (It has been pointed out to me that this wouldn't be a great scheme,
as CM2 memory isn't virtual, so it's much more limited compared to
front-end memory.)
--
Barry Margolin
System Manager, Thinking Machines Corp.
barmar@think.com {uunet,harvard}!think!barmar
Technical Details
Message-ID:
<1bflouINNr1u@early-bird.think.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!think.com!barmarReferences:
<9210131832.AA11060@vapor.Franz.COM> <1490.719005371@bbn.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.clos Subject: Re: How to neatly destroy instances? Date: 13 Oct 1992 23:23:10 GMT Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 26 Message-ID: <1bflouINNr1u@early-bird.think.com> References: <9210131832.AA11060@vapor.Franz.COM> <1490.719005371@bbn.com> NNTP-Posting-Host: telecaster.think.com