Re: std::string bad design????
Mirek Fidler wrote:
If you are going multithreaded, you must serialize access to
containers, end of story. (Of course, you could also consider
containers with internal locking, but that does not work well).
What I find odd is that you, Mirek, are the first person in, perhaps,
my last 10-15 posts about multi-threading to explicitly state this,
both in this thread and concurrent threads (no pun intended) .
It is incredibly perplexing to me that people keep saying, "But...If
Thread A and Thread B access the same global static variable of a
[insert name of your favorite C++ class here] at the same time, then
there will be a contention problem."
Of course!!!!!!!
I would imagine that there is no computer science department at any
university in the world that does not teach this. There is no book on
operating system in the world that was written in say, the last 20
years, that does not teach this.
Why is it that so many experts and neari-experts find this utterly
obvious fact remarkable?
I am not simply asking this question rhetorically. Please, if anyone
knows, tell me, so I can stop assuming that it is lack of experience
with multi-threading, which, IMO, would still not be an excuse.
Is it expectation that C++ will somehow develop some universally
applicable lock-free mechanism?
What, what, what? LOL. :)
Extremely curious,
-Le Chaud Lapin-
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]