Re: [gtk-list] Re: Garbage Collection and other things (belated)



On 17 Apr, Kenneth Albanowski wrote:
>[snip]
>> + There are tools out there that specifically attack the problem of GC,
>>   and do it pretty well.  The Boehm garbage collector from Xerox Parc
>>   comes to mind as being the most general. In retrospect, though I
>>   learned a lot by implementing several different kinds of GC, I
>>   would've have been better off had I just used Boehm's GC from the
>>   start.  It works with C and C++, threads, and will more or less do
>>   exactly what you want so long as you don't violate a few invariants,
>>   which are very clearly stated in his excellent papers.  It's worth
>>   looking at even if you don't use it.
> 
> The main problem is that any dicussion of GC and C always winds up at the
> same place: you can't implement automatic GC portably and reliably, and
> its just not worth trying.

I don't mean to keep beating on this, but have you read Boehm's papers
or looked at his work?  It's pretty impressive, and has been ported to a
lot of environments.  I only ask this because for some reason this is
one area that everyone seems to think is in the "roll your own"
category, and, having done so myself, I'm beginning to wonder if
perhaps it might not be better to at least *try* using someone else's
first.  I've often thought it would be nice, if I had time, to slip
his GC into {X,}Emacs, as the sizes of my XEmacs processes seem to
continue expanding with every passing day, and elisp has an absolutely
pathetic garbage collector.

In any event, I, for one, do not think that you can't implement this
portably or reliably, especially in the context of something like gtk,
or whatever gtk turns into.  You do have to really think about it,
though, and it's much, much harder to take something built around
reference counts and change it to use another scheme than just doing it
a different way from the start.

[Information on the Boehm-Demers-Weiser conservative garbage collector
is available at http://reality.sgi.com/employees/boehm_mti/gc.html]




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]