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

Steve Holden steve at holdenweb.com
Fri Sep 14 08:15:41 CEST 2007


Hrvoje Nikšić wrote:
> On Thu, 2007-09-13 at 13:15 +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.
> 
> More precisely, Python will call the deallocator appropriate for the
> object type.  If that deallocator does nothing, the object continues to
> live.  Such objects could also start out with a refcount of sys.maxint
> or so to ensure that calls to the no-op deallocator are unlikely.
> 
The thought of adding references is amusing. What happens when a 
refcount becomes negative by overflow? I know, I should read the source ...

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC/Ltd           http://www.holdenweb.com
Skype: holdenweb      http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline



More information about the Python-Dev mailing list