STL is not thread safe because many people do not need thread safety, and because it introduces the context of streaming into classes that would otherwise not need to know anything about the concept of threads.
You can encapsulate access to containers and provide your own thread safety (or other restrictions imposed by your specific design and implementation).
source
share