Re: Stream thread-safety
On Feb 13, 6:51 am, "Chris Thomasson" <cris...@comcast.net> wrote:
[...]
Thread-Safe in what context? basic or strong?
I'm not familiar with those terms. Thread safe means,
basically, specifying how objects of the class must behave in a
multithreaded environment. If a class has a contract which
specifies what the user must do in a multithreaded environment,
it is thread safe. If it doesn't it isn't.
Obviously, since there is a contract, the user must uphold his
end of it as well, or you have undefined behavior. But "thread
safety" is largely a question of specification and
documentation, not of any particular code behavior. (Although I
suppose one could argue that if the contract said that all use
of the class must be synchronized externally, including use of
two different instances, that the class wasn't thread safe.)
--
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