[Python-Dev] Tagged integers

Christian Tismer tismer at stackless.com
Mon Jul 19 23:09:29 CEST 2004


Tim Peters wrote:

> [Christian Tismer]
> 
>>...
>>Boehm GC might become feasible.
>>If we then can write C extensions without having to think
>>of reference counts, code would be simplified quite
>>much, and I would save 80 percent of debugging time.
> 
> 
> There's no escape from gc debugging nightmares at the C level,
> regardless of gc strategy.  With Boehm gc (Bgc) you have to ensure
> that all live objects are reachable from what Bgc guesses is the
> current root set, and screwing that up is just as deadly as screwing
> up refcounts.  It's harder to debug, though, because refcounting is
> very simple to picture, while Bgc is a relatively huge pile of
> complicated code in its own right.  I'm sure Neil Schemenauer still
> has fond memories of the pleasant days he spent trying to account for
> Tk crashes last time he tried hooking Bgc to Python <heh>.  Bgc has a
> special entry point to call, to register roots that Bgc can't find on
> its own -- guess how *you* find out which roots those are?  One crash
> at a time, and in the presence of threads you're damned lucky to get a
> repeatable test case.

Well, I was about to stick with this answer.

Then I saw that Prothon is going a different path: They don't
use a Boehm gc, but they make every object indirect, over a
global object table, and use generational garbage collection
with arenas.
I guess this would not lead to problems like stack introspection,
finding roots etc., because all objects are in the object table.
Of course it is another level of indirection
everywhere, with the advantage that object bodies become moveable.
I think this is a simple enough gc to shorten the nightmares.
No idea how much the performance loss is, or if this is amortized
by the missing reference counting? At least an opportunity to try
would be nice to have.

If not now, we will try it with PyPy, anyway -- ciao - chris

-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  mobile +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/



More information about the Python-Dev mailing list