-   Linux - Software (
-   -   pthread source code (

girish_hilage 10-08-2007 08:35 AM

pthread source code

Can anybody please let me know wherefrom can I get the Pthread source code for BSD version?


studioj 10-09-2007 05:02 PM

good question and we here at linux questions i think don't know the answer.
there are lots of pthread implementations.
Linux threads is now a part of glibc so it seems to use linuxthreads you would have to use a glibc based bsd variant.
anyway the linuxthreads code is in the GNU glibc package.

girish_hilage 10-12-2007 10:01 AM

Thanks for your reply.
But, I have one confusion.
The pthread library (provided by glibc-devel) which I use on my linux machine is a pthread or linux thread?
i.e. if linux threads are nothing but pthreads itself?
or linux threads is different implementation than pthreads?
I have this confusion because, I think thread libraries on solaris/other operating systems have the library function names starting with thr_*() or something like that. So, I thought linux threads would also have names starting with lthread_*() just like pthread_*() for POSIX threads. Hence my impression is, linux threads is a different library than pthread but could not get any document clearly specifying this. Some documents specify that linux threads is an implementation of posix threads.
So, is POSIX threads is just a standard and linux threads is built(with few exceptions) as per this standard?

studioj 10-12-2007 12:58 PM

yes POSIX threads is just a standard that defines an API and libraries comply with or do not comply with the standard.
Binary Incompatabilities exist between the libraries mostly only to the extent they do not comply with the POSIX standard.

Linux currently uses (since around 2003) the NPTL "native POSIX threading library" now included in the GNU C library

linuxthreads was the old GNU library we used before NPTL.

you can look at the interface /usr/local/pthread.h

it is the same interface from the older linuxthreads library.

All times are GMT -5. The time now is 07:22 AM.