[issue8800] add threading.RWLock

Kristján Valur Jónsson report at bugs.python.org
Tue Oct 2 14:09:50 CEST 2012


Kristján Valur Jónsson added the comment:

This amount of code provides recursion, context managers, condition variable compatibility, timeout functionality, error checking and conformance with the unit tests.

The actual locking code is encapsulated in the three functions acquire_read(), acquire_write, release().

The requirements and possibilities between threading and multiprocessing are many and multiple.  Sharing the implementation has the drawback of imposing the shortcomings and preformance bottlenecks of the multiprocessing implementation on the threading implementation, for no good reason.

I't tell you about good programming practice, but I'm too busy trying to understand the actual locking policy in your patch.  Sometimes comments in code can be helpful.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8800>
_______________________________________


More information about the Python-bugs-list mailing list