🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sw.components
Article #120

Re: Vagueness [was Re: Garbage Collection & ADTs]

#120
From: Michael Wolf
Date: Fri, 22 Sep 1989 00:26
33 lines
2330 bytes
In article <11885@polya.Stanford.EDU> maslen@Polya.Stanford.EDU (Thomas Maslen) writes:
>My guess is that any ADA solutions we see to my hypothetical problem
>will involve auxiliary "appropriate ADTs" which are just limited
>private types containing a pointer to the reference-counted real ADT.

I don't see what the problem is with passing around private types
with pointers to reference-counted ADT's.  It adds a small amount of
overhead to pointer references, and a couple bytes per object for
reference counts.  If you've got a language which enforces the
"private" part, you're pretty damn sure that your reference count
is correct, and it's then easy to tell when it is or isn't okay
to deallocate an object.  The only thing you need is a destructor
routine called on each "private" pointer when it goes out of scope
or get's deallocated.

The nice thing about this approach is that you KNOW that garbage
collection isn't going to unpredicatably impact your performance.

Now, if you can find a GC algorithm that's as efficient, I'll consider
switching.  Also, I don't see that writing such a reference counting
ADT is all that much tougher then writing the same ADT without
the reference counting, so it doesn't take too much extra development
time.

There may be algorithms which require so many pointer references, and
so little memory allocation/deallocation that a little GC would be
more efficent, but I'm betting they're in the minority.  Of course,
it's possible to get applications where you can't afford the space
overhead of a couple bytes per object, and then GC would be the
way to go.

Michael Wolf            These opinions are bootleg from Taiwan, so it comes
mwolf@Teknowledge.COM   as no surprise to find that they're defective.
Technical Details
Message-ID: <282@alfred.Teknowledge.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!wuarchive!gem.mps.ohio-state.edu!usc!ucsd!ucbvax!agate!shelby!vaxc!Teknowledge.COM!mwolf
References: <900@scaup.cl.cam.ac.uk> <6530@hubcap.clemson.edu> <11885@polya.Stanford.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!wuarchive!gem.mps.ohio-state.edu!usc!ucsd!ucbvax!agate!shelby!vaxc!Teknowledge.COM!mwolf
From: mwolf@Teknowledge.COM (Michael Wolf)
Newsgroups: comp.sw.components
Subject: Re: Vagueness [was Re: Garbage Collection & ADTs]
Message-ID: <282@alfred.Teknowledge.COM>
Date: 22 Sep 89 00:26:16 GMT
References: <900@scaup.cl.cam.ac.uk> <6530@hubcap.clemson.edu> <11885@polya.Stanford.EDU>
Reply-To: mwolf@Teknowledge.COM (Michael Wolf)
Organization: Cimflex Teknowledge Corp., Palo Alto CA
Lines: 33