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 <rep...@bugs.python.org> <http://bugs.python.org/issue8800> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com