Mailinglist Archive: opensuse-programming (55 mails)
| < Previous | Next > |
Re: [suse-programming-e] linux Threads vs. NPTL
- From: Jerry Feldman <gaf@xxxxxxx>
- Date: Fri, 4 Mar 2005 09:45:56 -0500
- Message-id: <200503040945.56406.gaf@xxxxxxx>
On Thursday 03 March 2005 6:10 pm, Dimych wrote:
> --- Jerry Feldman <gaf@xxxxxxx> wrote:
> > Is there any definitive way that a threaded app can
> > detect which thread
> > library it is using, the older Linux Threads or the
> > newer Native POSIX
> > Thread Library. I have found a few functions, such
> > as pthread_tryjoin_np(),
> > that exist only in NPTL, but that will prevent a
> > program from linking with
> > the Linux Threads library.
>
> Why do not you just use #ifdefs and specify what
> library to use as a build parameter?
That's not my point.
I was looking for a run-time check.
When building with NPTL, I set
CFLAGS=-pthread -I/usr/include/nptl -L/usr/lib/nptl
This points the build at the correct library and header file.
Also, I posted this originally to suse-programming-e.
--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
> --- Jerry Feldman <gaf@xxxxxxx> wrote:
> > Is there any definitive way that a threaded app can
> > detect which thread
> > library it is using, the older Linux Threads or the
> > newer Native POSIX
> > Thread Library. I have found a few functions, such
> > as pthread_tryjoin_np(),
> > that exist only in NPTL, but that will prevent a
> > program from linking with
> > the Linux Threads library.
>
> Why do not you just use #ifdefs and specify what
> library to use as a build parameter?
That's not my point.
I was looking for a run-time check.
When building with NPTL, I set
CFLAGS=-pthread -I/usr/include/nptl -L/usr/lib/nptl
This points the build at the correct library and header file.
Also, I posted this originally to suse-programming-e.
--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
| < Previous | Next > |