[Python-3000] Delayed reference counting idea
Raymond Hettinger
rhettinger at ewtllc.com
Mon Sep 18 21:56:27 CEST 2006
[Adam Olsen]
> I don't like the idea of a conservative GC at all in general, but
> Boehm GC seems to have very good quality, and it's easy to use from
> the point of view of a C API.
Several thoughts:
* An easier C API would significantly benefit the language in terms of
more extensions being available and in terms of increased reliability
for those extensions. The current refcount scheme results in pervasive
refleak bugs and subsequent, interminable bughunts. It adds to code
verbosity/complexity and makes it tricky for beginning extension writers
to get their first apps done correctly. IOW, I agree that GC without
refcounts will make it easier to write good C code.
* I doubt the anecdotal comments about Boehm GC with respect to
performance. It may be better or it may be worse. While I think the
latter is more likely, only an implementation patch will tell the tale.
* At my company, we write real-time apps that benefit from the current
refcounting scheme. We would have to stick with Py2.x unless Boehm GC
can be implemented without periodically killing responsiveness.
[Barry Warsaw]
> What worries me is the unpredictability of gc vs. refcounting.
> For some class of Python applications it's important that when
> an object is dereferenced it really goes away right then.
> I /like/ reference counting!
No doubt that those exist; however, that sort of design is somewhat
fragile and bugprone leading to endless sessions to find-out who or what
is keeping an object alive. This situation can only get worse when
new-style classes become the norm. Also, IIRC, bugs involving __del__
have been one of the more complex, buggy, and dark corners of the
language. Statistics incontrovertibly prove that people who habitually
avoid __del__ lead happier lives and spend fewer hours in therapy ;-)
Raymond
More information about the Python-3000
mailing list