std::string & multithreading

Dave Korn dave.korn.cygwin@googlemail.com
Sat Feb 27 16:02:00 GMT 2010


On 26/02/2010 20:06, Radu Marginean wrote:

> Is there any method to avoid this problem?

  Standard synchronisation techniques should be used to protect shared
strings, just as for any other object or resource.  You wouldn't expect to get
away with linking or unlinking items from a list in multiple threads in
parallel without wrapping a lock or semaphore around the operation; same goes
for strings and string operations.

    cheers,
      DaveK



More information about the Libstdc++ mailing list