[ace-users] ACE_String vs. std:string

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Tue Jul 10 12:41:34 CDT 2007


Hi Michael,

> Thanks for the fast response Steve.  What I had in mind for
> thread-safety is the following.  I recall an earlier implementation of
> string (prior to the C++ standard being approved) that may have been
> part of SGI STL (I can't recall), called bastring.h.  It involved a
> static string object that I believe represented the null string, and
> this object wasn't thread protected (had an internal reference count
> that could become corrupted).  I'm told that this is not the case with
> the std::string in recent gcc compilers.  But still, string instances
> have the same threadedness issues that any other standard container
> have.  Two threads cannot access the string instance at the same time.

Right, that's by design - to avoid slowing the common (i.e.,
non-threaded access) case.

Take care,

     Doug



More information about the Ace-users mailing list