678 Subj : Re: Deadlock theorem To : comp.programming.threads From : Uenal Mutlu Date : Tue May 03 2005 05:16 am "Peter Koch Larsen" wrote > "Uenal Mutlu" skrev i en meddelelse > > > Please take a look at the example I'd posted (reposting it below). > > Especially what happens inside thread5 (But: it is by no means > > said that the deadlock actually will happen inside thread5! It only > > says that deadlock will happen for sure if not followed the theorem, > > or inversing this: no deadlock will happen for sure if the theorem is > > applied. > > > > So.... are you posting a theorem that argues that deadlock will happen for > sure if you do not follow it? That is - if following it, you MIGHT get a > deadlock, but also you might not? Nope. It's simple: If you follow the theorem then a deadlock will not happen. If you don't then deadlock will happen (unless you use other locking and/or deadlock prevention mechanisms). The advantage of this theorem is: you don't need any special deadlock prevention mechanisms if you follow the theorem which only says that you shall do lock your objects in a specific order, nothing more. Ie. this method is easy and fast. > First I am sceptical of that theorem: where is the proof? > Second (and far more important): what is the value of that theorem? I can > find no value whastsoever. It is IMO very important to the field of parallel processing (for example operating system design, multithreading app design), and also to the field of databases. It is equally important for both low-level (system) design (for example API) and high-level application design. . 0