Queue cleanup

Aahz aahz at pythoncraft.com
Sat Aug 28 14:42:55 CEST 2010


In article <4c78572c$0$28655$c3e8da3 at news.astraweb.com>,
Steven D'Aprano  <steve at REMOVE-THIS-cybersource.com.au> wrote:
>On Fri, 27 Aug 2010 09:16:52 -0700, Aahz wrote:
>> In article <mailman.1967.1281549328.1673.python-list at python.org>, MRAB 
>> <python at mrabarnett.plus.com> wrote:
>>>
>>>An object will be available for garbage collection when nothing refers
>>>to it either directly or indirectly. If it's unreferenced then it will
>>>go away.
>> 
>> This isn't actually garbage collection as most people think of it.
>> Refcounting semantics mean that objects get reaped as soon as nothing
>> points at them.  OTOH, CPython does also have garbage collection to back
>> up refcounting so that when you have unreferenced object cycles they
>> don't stay around.
>
>I've repeatedly asked, both here and elsewhere, why reference counting 
>isn't "real" garbage collection. Nobody has been able to give me a 
>satisfactory answer. As far as I can tell, it's a bit of pretentiousness 
>with no basis in objective fact.

You'll notice that I was very careful to qualify my statement with "as
most people think of it".  Also, because CPython has two different memory
management mechanisms, refcounting and cycle detection, and the module
that controls cycle detection is called "gc", I think it's simpler to
follow along with the Python docs -- and critically important to remind
people that there are in fact two different systems.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"...if I were on life-support, I'd rather have it run by a Gameboy than a
Windows box."  --Cliff Wells



More information about the Python-list mailing list