This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Re: Is libstdc++ in stock egcs 1.1.2 thread-safe?


> 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


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