Subj : Re: recursive mutexes To : comp.programming.threads From : David Butenhof Date : Thu May 19 2005 07:06 pm Uenal Mutlu wrote: > "David Butenhof" wrote > >>Uenal Mutlu wrote: > > 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. It just completely slipped your mind that it might be important to mention this? Hmm. But, you haven't said anything about scaling, even here. You've said that you found your own recursive mutex to be twice as fast as Window's CriticalSection (which isn't something I've ever heard held up as a paragon of performance, incidentally). If the ratio between your recursive mutex and CriticalSection is that same on uniprocessor and dual processor, then, fine, they both scale the same. But is that scaling GOOD or BAD? To put it another way, nothing you've said here has any bearing at all on my question, nevermind being an ANSWER to the question. I'm not interested in the straightline performance of CriticalSection or of your recursive mutex; I'm concerned about the effect on application concurrency of your application design. > 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? I think you've not been listening. Try reading it again, because I don't have time right now to repeat. >>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. Good start. Now, it's vaguely possible (though unlikely) that your synchronization is spread out among so many mutexes that you have relatively low contention and are getting concurrency despite your long-hold recursive mutex design. I wouldn't believe that without verification, though. You may HAVE two CPUs; but are you actually using them? -- Dave Butenhof, David.Butenhof@hp.com HP Utility Pricing software, POSIX thread consultant Manageability Solutions Lab (MSL), Hewlett-Packard Company 110 Spit Brook Road, ZK2/3-Q18, Nashua, NH 03062 .