Subj : Re: Challenge: Multithreading & Synchronization To : comp.programming.threads From : Uenal Mutlu Date : Thu May 19 2005 07:21 pm "Sergei Organov" wrote > "Uenal Mutlu" writes: > > "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. > > No, I don't. It's you who are looking for simple solution to a complex > problem and believe that recursive mutex is the answer, isn't it? Yes, I try to find a way to simplify, to generalize these complex things, if possible to find an algebra for it. > > 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 didn't have any objection. What I'm saying is that your own statement > cited above: > > > > > > > But if the data objects are independent of each other then it > > > > > > is more efficient to let each have its own mutex. > > now appears to be plain wrong from your own point of view, right? Hmm, sure it does not apply to such extreme examples like your 3D-point, but for most practical data (esp. containers/arrays) which have to be accessed concurrently it does, doesn't it? I have to wonder how you come on such an idea to believe that my statement would include even such trivial cases like the 3 parts of a 3D point, hmm... .