Subj : Re: Challenge: Multithreading & Synchronization To : comp.programming.threads From : Torsten Robitzki Date : Thu May 19 2005 01:41 pm Uenal Mutlu wrote: > "Sergei Organov" wrote > > Hmm. so you are using just one mutex for the whole class (for all shared > data objects). This is not the recommended way because you are blocking > too much and too long. Imagine if inside f2() the mutex is locked, then no > other thread can do anything else; all have to wait for f2() release the mutex. > By using just one mutex you effectively made the program practically "single-threaded". > IMO this approach is far from being efficient. > Why not use 3 mutices?... I would guess, because it's a quick hack to an already broken design. And a quick hack leads to more time for a clean redesign. Why using threads and thus a mutex for that "real-world-problem" at all? regards Torsten .