Subj : Re: Lockable objects To : comp.programming.threads From : Torsten Robitzki Date : Thu May 19 2005 08:27 pm Uenal Mutlu wrote: > A mutex can be realized in just 8 bytes (counter and threadid). > These methods would be like any other method of the object: > just use which you want/need/like, or don't use at all: you have the choice. I don't have the choice if I want to reserve 8 bytes for every container for no benefit or not. And 8 bytes can be a hugh amount of memory if you consider that an empty vector usually just claims the space for 3 pointers. And there are applications that have hugh amounts of empty containers. > The advantage of having such an "architecture" in the language > gives far more possibilities for the users. And now a new buzzword: "architecture". Calling having a mutex in every container an "architecture" is just ... 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 > ? > And: multithreading has become a de facto standard in programming, > esp. in application programming. Really? Did your teacher told you that? Why especial for application programming? .