[issue3001] RLock's are SLOW

Hugh Gibson report at bugs.python.org
Thu Oct 9 07:39:11 CEST 2008


Hugh Gibson <hgibson at abling.com> added the comment:

> I doubt subclassability of RLock matters but who knows, people do code
> things.

I've recently done this to implement potential deadlock detection. I 
keep a record of the sequences of acquired locks, find unique 
sequences, then check for conflicts between each sequence. There's not 
much overhead and it highlighted some potential deadlocks where lock A 
and B were acquired AB in one route through code and BA in another 
route. The algorithm is a simplified version of that used in Linux - 
see http://www.mjmwired.net/kernel/Documentation/lockdep-design.txt

Hugh

----------
nosy: +hgibson50

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


More information about the Python-bugs-list mailing list