Subj : Re: Deadlock theorem To : comp.programming.threads From : David Schwartz Date : Mon May 02 2005 06:11 pm "Uenal Mutlu" <520001085531-0001@t-online.de> wrote in message news:d56846$df9$00$1@news.t-online.com... > The theorem works. > The example you are referring to was a (theoretical) example > where the following happens inside a single thread: > o1.Lock(); > o2.Lock(); > o3.Lock(); > o1.Unlock() > o2.Unlock(); > o1.Lock(); > > The reason was just to show that the methods (mine vs. hierarhical > locking) > are really different at least in such a case. Ie. in my method the o3 > lock > does not need to be unlocked before being able to lock o1 again, whereas > in hierarchical locking it is necessary to unlock all objects deeper in > the hierarchy. Then your theorem is simply false. Consider the example above. When the thread goes to lock 'o1' for the second time, it could deadlock with another thread that holds the 'o1' lock and is waiting for the 'o3' lock. DS .