Subj : Re: Challenge: Multithreading & Synchronization To : comp.programming.threads From : Uenal Mutlu Date : Thu May 19 2005 06:19 pm "Sergei Organov" wrote > "Uenal Mutlu" writes: > > > "Uenal Mutlu" writes: > > > > > > [...] > > > > But if the data objects are independent of each other then it is > > > > more efficient to let each have its own mutex. > [...] > > In this case IMO it does not make much sense to lock X, Y, Z individually. > > It depends on what kind of access to the data you want for your threads. > > It's an issue of the application logic. > > In the above I've skipped everything and left two consecutive > statements of yours. Please read them... Done? > > Now I wonder are you actually one person or at least two?! Hopefully you > don't in fact experience split personality :) No, I don't. But try to understand that these things are complex and difficult to describe. You on the other side are looking for simple answers to such complex problems. Try to understand my reply to Maciej Sobczak. There I've tried to explain these cases along with examples. The right decision depends on the access level to the data you want to grant each thread, and the concurreny level among the threads. I've listed 3 cases there: just pick the right one which fits the requirements of your project. In the end it is your own decision, nobody else can solve it for you unless you make all the requirements of your project available for a study. If you have an example just post and we'll see what possibly would be the best way. .