This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
is gcc 2.95.2 -pthreads recommended?
- To: gcc bug list <gcc-bugs at gcc dot gnu dot org>
- Subject: is gcc 2.95.2 -pthreads recommended?
- From: Martin Sebor <sebor at roguewave dot com>
- Date: Tue, 20 Mar 2001 17:38:18 -0700
- CC: libstdc++ at gcc dot gnu dot org, hunt at roguewave dot com
- Organization: Rogue Wave Software, Inc.
Hi,
Is gcc -pthreads the recommended way of using libstdc++ (with 2.95.2)
in an multi-thread safe way? I'm having trouble finding any documentation
on either -pthreads (or -threads on Solaris), or the -D_PTHREADS macro
it #defines.
>From libstdc++ sources it seems that the library will not be thread-safe
to use without -D_PTHREADS (or __STL_PTHREADS).
Also, is --enable-threads supposed to cause gcc to #define _PTHREADS
or __STL_PTHREADS by default? We have gcc installations that appear
to #define __STL_PTHREADS by default (on Linux?), and we have others
(built on SunOS 5.8 with and without --enable-threads) that do not.
Thanks in advance!
Martin