Re: Thread Safe, Standard Template Library, and C++
On Sep 26, 2:54 pm, Steven Woody <narkewo...@gmail.com> wrote:
are those containers provided in std thread safe? if not, does
the std ( or the language itself ) provide any method to
protect critical section in a thread unsafe operation?
The current version of the standard doesn't consider threads.
The next version will.
All of the implementations of the STL that I know of for the
"usual" machines (PC's under Windows or Linux, Sparc's under
Solaris, etc.) are thread safe, but do read the exact contract
each implements. (Modulo errors, of course. There is an error
in the g++ implementation of std::string, for example, although
it's really a very rare program which will encounter it. And
arguably, it's not an error because g++ doesn't claim to respect
the Posix guarantees, but only a much weaker set.)
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34