Circular references (was: Defining VCL-like framework for Py

Yoo C. Chung wacko at laplace.snu.ac.kr
Tue May 25 22:59:00 EDT 1999


Gordon McMillan writes:

> But ref counting depends only on what goes on inside my process. GC
> is influenced by other things.

For example?

Depending on the implementation, garbage collection can always occur
at exactly certain fixed points for single threaded apps.  (This
sometimes eases the implementation of a garbage collector, since I can
set conditional breakpoints to see just which part is allocating a
piece of misbehaving memory.)

On the other hand, garbage collection in multithreaded apps is almost
never deterministic, but the same can be said for reference counting.
In addition, reference counting could suffer a large performance hit
in multithreaded apps since every update must be protected by a mutex
in a naive implementation.

Not that I'm advocating the use of garbage collection in Python.  I'm
just pointing out that garbage collection can be deterministic (though
maybe not in the way people want it to be).

--
Yoo C. Chung <http://laplace.snu.ac.kr/~wacko/>
School of Electrical Engineering, Seoul National University




More information about the Python-list mailing list