[Python-Dev] deja-vu .. python locking

Martin Devera devik at cdi.cz
Mon Sep 18 19:08:16 CEST 2006

>> So that you are right. It is not RCU. It only uses similar technique as RCU
>> uses for free-ing old copy of data.
>> It is based on assumption that an object is typicaly used by single thread. 
> Which thread owns builtins?  Or module dictionaries?  If two threads are
> running the same function and share no state except their globals, won't
> they constantly be thrashing on the module dictionary?  Likewise, if the
> same method is running in two different threads, won't they thrash on the
> class dictionary?

As I've written in "Big reader lock" paragraph of the original proposal, these
objects could be handled by not blocking in read path and wait for all other
threads to "come home" before modifying.
The selection between locking mode could be selected either by something like
__locking__ or by detecting the mode.

More information about the Python-Dev mailing list