Read-write lock for Python

Ryan Kelly ryan at
Thu Apr 28 18:38:12 EDT 2011

On Thu, 2011-04-28 at 07:02 -0700, Geoff Bache wrote:
> Hi all,
> I currently find myself needing a Python read-write lock. I note that
> there is none in the standard library, but googling "python read-write
> lock" quickly produced 6 different competing examples, including two
> languishing patch proposals for the standard library.
> I can always pick a random one and hope for the best, but I was hoping
> someone here might have a tip for one that has been used and debugged
> and is likely to work.

I wrote and have used the "SHLock" class in threading2 which should do
what you need.  Don't know about "likely to work" but if it doesn't, I'd
like to hear about it so I can fix it :-)

  `pip install threading2`



Ryan Kelly  |  This message is digitally signed. Please visit
ryan at        | for details

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <>

More information about the Python-list mailing list