This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: std::string & multithreading


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]