Subj : Re: recursive mutexes To : comp.programming.threads From : Uenal Mutlu Date : Thu May 19 2005 05:58 pm "David Butenhof" wrote > Uenal Mutlu wrote: > >>Sorry, there is no alternative to not use threads in most practical applications of today > > > > should read: "there is no excuse to not use threads in most practical applications of today" > > You clearly did not understand what I was saying. When you use recursive > mutexes, either: > > A) You are using them as normal mutexes, but wasting straightline > compute time. Fine, but pointless. > > B) You are commonly operating with recursively locked mutexes, > dramatically increasing your average hold-times and therefore radically > DECREASING your concurrency. You are, in fact, NOT writing concurrent > code; you are using threads strictly as a convenient application > structuring mechanism. That's not true. As more than once said: it's just an increment of the lock-counter what's happening in a recursive lock. > That you have not run on a multiprocessor, or done any form of > scalability measurements, explains a lot. Like why you think "simple" > recursive mutexes are a good idea. You simply have no idea what you're > talking about. I'm sorry I had forgotten to mention that I already had tested my recursive mutex implementation on a machine with 2 CPUs (Intel P4 Dual) some weeks ago. The test was to test its performance vs. the standard method of Win32 (CriticalSection). The resulting relation was the same as on a uniprocessor, that is: my implementation was always at least twice faster. Since you have more experience than me on SMP can you tell me what do you think is the biggest reason which would make the use of a recursive mutex slower on SMP? Is it the internal cache issue of the CPU? Or is it just the above mentioned reasons? > If you're happy in your uniprocessor "ghetto", that's fine with me. > Nothing wrong with that at all. No, I'm of course not, I'll soon get a dual CPU machine with AMD Opteron CPU. Currently I'm having full remote access to the above mentioned machine which is an app server for testing. .