437 Subj : Re: Deadlock theorem To : comp.programming.threads From : Joe Seigh Date : Sun May 01 2005 04:51 pm On Sun, 1 May 2005 19:18:11 +0200, Uenal Mutlu <520001085531-0001@t-online.de> wrote: > Theorem: > a) "There will be no deadlock if the objects are locked in the same order." > b) "Unlocking can be done in any order." > > Some explanation: > "Order" in this context means sequence. > The theorem applies equally well to both sequential and parallel processing > (ie. threads, tasks, processes, coroutines etc.), and regardless of the number > of objects one wishes to lock in any of the parallel running units (aka threads). > That is: the objects designated for locking, and the number of them, can be > different in each thread; only the locking sequence (order) must be the same in all threads. > > (If this theorem is new then I would like to give it the name "Mutlu theorem" :-) > > It's known as hierarchical locking. -- Joe Seigh When you get lemons, you make lemonade. When you get hardware, you make software. . 0