This is the mail archive of the
mailing list for the GCC project.
Re: STL safe for use in multi-threaded programs?
- To: Adrian Miranda <ade at psg dot com>
- Subject: Re: STL safe for use in multi-threaded programs?
- From: Dima Volodin <dvv at dvv dot org>
- Date: Thu, 11 Nov 1999 16:46:50 -0500
- CC: gcc at gcc dot gnu dot org
- Organization: Huh?
- References: <email@example.com>
Adrian Miranda wrote:
> Are there any known problems with thread-safely in the STL? I was
> using a couple of the following:
> map<string, map<string, string> >
> My multi-threaded program was suffering from irregular core dumps deep
> within some STL memory allocation routines (it appeared). Once I
> surrounded all use of the map with a mutex, the core dumps when away.
> This is compiled with gcc 2.95.1, on Solaris 2.6 sparc.
> Is this a known problem, or should I try to track it down further?
It's a known problem - the gcc's STL string implementation is not
thread-safe. You might want to have a look at SGI's implementation -
while it's arguably is not as efficient as the gcc's one, it's certainly