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

Martin Devera devik at cdi.cz
Tue Sep 19 09:39:28 CEST 2006


Greg Ewing wrote:
> Martin Devera wrote:
> 
>> As I've written in "Big reader lock" paragraph of the original 
>> proposal, these
>> objects could be handled by not blocking in read path
> 
> But as was just pointed out, because of refcounting,
> there's really no such thing as read-only access to
> an object. What *looks* like read-only access at the
> Python level involves refcount updates just from the
> act of touching the object.
> 

Yes I was thinking about atomic inc/dec (locked inc/dec in x86)
as used in G.Stein's patch.
I have to admit that I haven't measured its performance, I was
hoping for decent one. But from http://www.linuxjournal.com/article/6993
it seems that atomic inc is rather expensive too (75ns on 1.8GHz P4) :-(

Greg, what change do you have in mind regarding that "3 instruction
addition" to refcounting ?
thanks, Martin


More information about the Python-Dev mailing list