This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: is gcc 2.95.2 -pthreads recommended?
- To: "Benjamin Kosnik" <bkoz at redhat dot com>,"Martin Sebor" <sebor at roguewave dot com>
- Subject: Re: is gcc 2.95.2 -pthreads recommended?
- From: "TC" <home_cray at yahoo dot com>
- Date: Tue, 20 Mar 2001 21:11:03 -0800
- Cc: "gcc bug list" <gcc-bugs at gcc dot gnu dot org>,<libstdc++ at gcc dot gnu dot org>,<hunt at roguewave dot com>
- References: <Pine.SOL.3.91.1010320172803.19157B-100000@cse.cygnus.com>
#define _POSIX_C_SOURCE 199506L
#define __EXTENSIONS__
did the trick for me when using pthread.h and semaphore.h while developing
multi-threaded TCP/IP apps. How is -pthread related to the above mentioned
defines? Does _PTHREADS define also _POSIX_C_SOURCE 199506L? Since all
multi-threaded libs on Solaris 8 are C libraries provided by SUN, you
definitely need those settings besides using -pthread in case this option
does not set those automatically.
--GT
----- Original Message -----
From: "Benjamin Kosnik" <bkoz@redhat.com>
To: "Martin Sebor" <sebor@roguewave.com>
Cc: "gcc bug list" <gcc-bugs@gcc.gnu.org>; <libstdc++@gcc.gnu.org>;
<hunt@roguewave.com>
Sent: Tuesday, March 20, 2001 5:29 PM
Subject: Re: is gcc 2.95.2 -pthreads recommended?
> > Is gcc -pthreads the recommended way of using libstdc++ (with 2.95.2)
> > in an multi-thread safe way?
> yes
>
> >
> > 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.
>
> __STL_PTHREADS is deprecated. That was usually defined in stl_config.h
>
> _PTHREADS is defined with -pthreads.
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com