On Tue, Apr 29, 2008 at 5:15 PM, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
You did not get my point.
My point is that if you follow the following locking discipline, a
deadlock will never be triggered:
* Always obtain writer locks in a consistent order.
* Never nest writer locks inside reader locks.
* Nesting reader locks inside writer locks is okay, and nesting reader
locks inside other reader locks is also OK.
Again: if you do not agree with the above, please post an example that
proves me wrong.
Or: whether or not to allow a sequence like "rlock(a); rlock(b);
runlock(b); runlock(a); rlock(b); rlock(a);" is something we can
choose. We do not have to forbid this sequence -- we can choose
whether or not we allow this sequence.
Bart.
--