Subj : Re: recursive mutexes To : comp.programming.threads From : Sergei Organov Date : Mon May 16 2005 02:06 pm "Uenal Mutlu" <520001085531-0001@t-online.de> writes: > "David Schwartz" wrote > > I never argued the performance issue. But here's a more realistic example: > > The example was in response to Peter's posting who wrote "No, he's in fact > making the program faster." > > To your question regarding the speed of recursive vs. non-recursive > locks: True, recursive locking is slower than non-recursive locking. > But recursive locking simplifies coding (no need to have a locked and > unlocked version of a function) and makes the application safer wrt > self-deadlocking. Yes, it simplifies coding in the sense that it makes it easier to write "working" program that is in fact incorrect. Please try to understand what others already told you: dead lock could be a good thing as getting it early and correct the problem is much better than hiding the problem behind recursive locks. If you in fact don't care about correctness of your programs, it's better to get rid of all the locking altogether, -- absolutely safe wrt deadlocks, simple, and pretty fast program you will get ;) -- Sergei. .