Is libstdc++-v3 thread-safe?
libstdc++-v3 strives to be thread-safe when all of the following conditions are met: • The system’s libc is itself thread-safe, • gcc -v reports a thread model other than ‘single’, • [pre-3.3 only] a non-generic implementation of atomicity.h exists for the architecture in question. The user-code must guard against concurrent method calls which may access any particular library object’s state. Typically, the application programmer may infer what object locks must be held based on the objects referenced in a method call.