
April 14, 2007
1:51 a.m.
Josiah Carlson wrote:
If thread B decrefs the global refcount, and it becomes 0, then it can check the thread refcount and notice it is nonzero and not deallocate, or if it notices that it *is* zero, then since it already has the GIL (necessary to have decrefed the global refcount), it can pass the object to the deallocator.
The problem with that is the owning thread needs to be able to manipulate the local refcount without holding any kind of lock. That's the whole point of it. -- Greg