This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Is libstdc++ in stock egcs 1.1.2 thread-safe?
- To: shmulik at Orbotech dot COM
- Subject: Re: Is libstdc++ in stock egcs 1.1.2 thread-safe?
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Wed, 22 Dec 1999 13:41:18 +0100
- CC: gcc at gcc dot gnu dot org
- References: <3860AF6E.9303DE80@orbotech.com>
> Under the above setting, is the implementation of new and delete
> thread-safe or do I have to take care of synchronization issues (mutex
> and the like) by myself?
[...]
> Additional info:
> glibc: 2.0.7
> Linux kernel: 2.2.x
> egcs: stock 1.1.2
> libstdc++: from stock egcs 1.1.2.
On this platform, provided gcc was configured with --enable-threads,
new and delete should be thread safe. New and delete only uses the
underlying malloc/free and exception handling, which in turn are
thread-safe.
As for libstdc++ (which new and delete is *not* part of): it is
"supposedly" thread-safe, if configured with --enable-threads. Both
STL and libio/iostreams should be ok. For <string>, there are reports
that there are problems, although nobody could point to the
problematic code, so far.
Regards,
Martin