This is the mail archive of the libstdc++@sourceware.cygnus.com 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]

Re: Thread safety and string



> "While parts of the SGI STL are used in libstdc++-v3, their string class
> is not. The SGI string is essentially vector<char> and does not do any
> reference counting like libstdc++-v3's does. (It is O(n), though.)
> Contrary to what some say, reference counting is not incompatable with
> multithreading, if done correctly"

Hmm. This is not as clear as it should be. I'm defining a thread-safe
container as per the SGI STL definition, here:

http://www.sgi.com/Technology/STL/thread_safety.html

v-3's string implementation uses ref-counted strings, and is thought to be
thread-safe. I would be interested in your experiences using it in such a
matter. Nathan Myers, its principal author, may be able to offer more info
and field more specific questions.

SGI STL 3.2 has another string implementation, which is also believed to
be thread-safe. There is also the SGI STL rope container. 

So you have a lot of choices, all of which should be thread-safe.

-Benjamin



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