This is the mail archive of the
mailing list for the libstdc++ project.
std::string & multithreading
- From: Radu Marginean <radu_marg at yahoo dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 26 Feb 2010 03:16:48 -0800 (PST)
- Subject: std::string & multithreading
Currently std::string cannot be safely used in a multithreaded environment due to features like copy on write and reference counting. Even programs that access two unrelated different string objects in a multicore machine may suffer random crashes.
Rogue Wave for example has a compiler option which allows linking with a version of the STL library that can be safely used in a multithreaded application. Is there any such option available for gcc? If not are there plans to introduce one?