This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
libstdc++, threads and cvs-gcc
- To: <gcc at gcc dot gnu dot org>
- Subject: libstdc++, threads and cvs-gcc
- From: Dennis Bjorklund <db at zigo dot dhs dot org>
- Date: Sat, 28 Apr 2001 20:47:45 +0200 (CEST)
What is the status about thread-safty and gcc (3.0). I have an application
made for windows that I want to port that uses the std::string class and
threads. It's not using the same strings in the different threads, but it
still seems to be an issue with memory allocation.
I have only tried to compile with 2.95.2 where it seems to work (i've run
it for days without problems) and with the snapshot that comes with rh 7.1
where it crashes at this point all the time:
at /usr/include/g++-3/std/bastring.h:114
114 void release () { if (--ref == 0) delete this; }
Is the c++ standard libraries supposed to work with threads? Do I really
have to protect every use of the string-class in the different threads
even though they don't operate on the same strings.
If I get the cvs gcc, would it work then? Or is there something else about
threads and gcc that I should know about. Can I get gcc (libstdc++) to use
threadsafe versions of these things.
--
/Dennis