Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?
steve at holdenweb.com
Sat Nov 4 04:50:11 CET 2006
> Daniel Dittmar wrote:
>>>garbage is collected earliest, when the refcount went to 0. If it ever
>>>went to 0, no one will ever use such object again. Thus GC should not
>>>be different at all.
>>Since Python 2.?, there's a mark-and-sweep garbage collection in
>>addition to the reference counting scheme. This was put into Python to
>>be able to reclaim object cycles.
> still that only walks on objects which have already zero refcount. Cannot imagine any additional problems with the GIL.
If I understand you correctly, then you are suffering a misapprehension.
Any object whose reference count goes to zero will immediately be
reclaimed. The mark-sweep garbage collector is used to detect objects
that are taking part in cycles - sets of objects that only refer to each
other without being bound to a name in any current namespace or to any
container object bound to such a name.
In other words, it detects (and reclaims) objects with non-zero
reference counts which nevertheless can be reclaimed without ill effect
on the program.
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden
More information about the Python-list