Re: [suse-programming-e] linux Threads vs. NPTL
--- Jerry Feldman
--- Jerry Feldman
wrote: Is there any definitive way that a threaded app can detect which thread library it is using, the older Linux Threads or
On Thursday 03 March 2005 6:10 pm, Dimych wrote: 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.
I had understood your point :) When saying "...that will prevent a program from linking with the Linux Threads library..." what exact errors are you getting? I though it's possible to link your programm against both those libraries at the same time.
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.
Sorry, my mistake
-- Jerry Feldman
Dmitry
I had understood your point :) When saying "...that will prevent a program from linking with the Linux Threads library..." what exact errors are you getting? I though it's possible to link your programm against both those libraries at the same time. There are some functions that exist in NPTL and not in Linux Threads. If you compile using only the Linux Threads libary (eg. /usr/lib/libpthread.so), and you code uses the function,
On Friday 04 March 2005 10:51 am, Dimych wrote:
pthread_tryjoin_np(), it will fail to link.
What I am really looking for is a way to detect at run time, if the code has
been linked with the nptl library or not.
--
Jerry Feldman
participants (2)
-
Dimych
-
Jerry Feldman