Subj : Re: Lockable objects To : comp.programming.threads From : Uenal Mutlu Date : Thu May 19 2005 11:23 pm "Torsten Robitzki" wrote > >>What can a user do with a container that have a buildin mutex that the > >>user can not do with a container plus a mutex? What is the difference of: > >>mutex m; std::vector v; > >> > >>to your approach and to something like std::pair > ? > > > > Many things could be automated, and more advanced things could be realized. > > Such argumentation like yours were also happening before templates in C++. > > Today they are very important. Tomorrow threading and locking of objects will be. > > I begin to wonder if you are a human beeing or just a agent of some AI > project. I've ask a cristal clean question and got some "everything will > by much easier" answer. > > So again for the robots: 0100100100001111010010010? > > Or in the more verbose form: > What is the difference between your silly approache and > std::pair > ? As I told you: A-U-T-O-M-A-T-I-O-N-!-!-! If it is documented then you, and any other object, knows the object has these synchronization members. You, and any other object, can see whether it is safe to change the object or not. In your approach nobody knows of your standalone mutex, whether if it exists or not, and for what purpose. This is not the case with an integrated mutex. .