Subj : Re: recursive mutexes To : comp.programming.threads From : Uenal Mutlu Date : Wed May 18 2005 11:25 pm "Sergei Organov" wrote > "Uenal Mutlu" writes: > > "Sergei Organov" wrote > > > "Uenal Mutlu" > > > I'm willingly making use of its recursivity feature because it > > simplifies many things, and most importantly it is safer than > > non-recursive locking, > > It depends on the definition of "safer". For me "safer" is not equal to > "no deadlock". True, and nobody has said that. A recursive mutex helps only for the current thread to not deadlock itself. But apart from this the same dangers for deadlock exist equally for both non-recursive and recursive mutices. If you apply my deadlock theorem then a deadlock cannot occur. If you also want to exclude self-deadlocking then the use of a recursive-mutex will solve even that case. What's left? > Using my definition of "safer", the recursive lock is not > safer due to the fact that it allows actual problems in the code to be > hidden for a long time. It depends whether you see the use of a recursive mutex as a problem or not. As I said: if I use a recursive mutex then I'm making use of its recursion feature. This then cannot be seen as an error (but we already had discussed this case). > > though it has a neglectable overhead. If I use a _recursive locking > > method_ then I'm of course aware of these facts. > > If you were aware of the experience that has been gathered in this > field, you won't use recursive locking method in the first place. I respect all the old veterans, but please let us also make some progress in the field, and not always chew the old gum.. > The recursive locks simplify your life by allowing you not to think > about quality of your design. Kinda like favorite goto's in programming > languages, -- they do simplify programming in the short run but the > result is usually a wrong and unmaintainable problem^H^H^H^Hgram in the > long run. If you consider such simplifications to be a good thing, -- > it's your problem. I would say that it is even much easier to develop a complex system and also much easier to maintain it by the use of recursive mutices. Nevertheless, this seems to be a religious issue, so I do respect your and other's view on this, but please try to respect my view and my preferance for recursive mutices too, since I've researched this field and am a prefessional developer with more than 15 yrs of experience, so I too know of what I'm talking of. Besides this, I strongly believe the future belongs to the recursive mutices for their simplicity and safety over non-recursive mutices, esp. for the huge and complex requirements nowadays and of the future. .