This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Definitive answer about thread-safety of std::string
- From: "Chad Attermann" <chad at broadmind dot com>
- To: <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 15 Nov 2007 12:16:35 -0700
- Subject: Definitive answer about thread-safety of std::string
While libstdc++ documentation makes it clear that the library is thread-safe
as long as an object is locked so that only a single concurrent thread can
access it, I have seen some conflicting statements elsewhere that elude to
the fact that std::string may be safe for access by concurrent threads. I
would appreciate if anyone could enlighten me on whether std::string is in
fact safe for access by concurrent threads without explicit locking, or if
it requires a read-write locks or a full locks instead.
Regards,
Chad.