[Python-Dev] Removing the GIL (Me, not you!)

Jon Ribbens jon+python-dev at unequivocal.co.uk
Thu Sep 13 13:55:38 CEST 2007


On Thu, Sep 13, 2007 at 01:15:39PM +0200, "Martin v. Löwis" wrote:
> > To put it another way, would it actually matter if the reference
> > counts for such objects became hopelessly wrong due to non-atomic
> > adjustments?
> 
> If they drop to zero (which may happen due to non-atomic adjustments),
> Python will try to release the static memory, which will crash the
> malloc implementation.

That could be avoided by a flag on the object which is checked in
free(). I'm just suggesting it as an alternative as it sounds like
it might be more efficient than either locking or avoiding having
reference counts on these objects (especially if the reference count
is initialised to MAX_INT/2 or whatever).


More information about the Python-Dev mailing list