views:

68

answers:

3

Hi,

I am trying to find the source code of pthread library. (I guess its a supposed to be a part of Linux source code)

But somehow can't find any good website that has it.

I like this website: http://lxr.linux.no/#linux+v2.6.34.1/ where I usually find what I need. Somehow pthread source is not searchable. Anyway, I wanted to mention that I need a link to a browsable (and searchable) website like that one.

Websites for browsing linux source can be a matter of personal taste. So all links to the pthread source are welcome.

Most probably I will end up bookmarking all of them, look thru them, and then accept the best answer.

Thanks all.

A: 

Did you look at GNU libc?

On my Debian box, I see

edd@mccoy:~$ dpkg -S /usr/lib/libpthread.so 
libc6-dev: /usr/lib/libpthread.so
edd@mccoy:~$ apt-cache show libc6-dev
Package: libc6-dev
Priority: optional
Section: libdevel
Installed-Size: 13172
Maintainer: GNU Libc Maintainers <[email protected]>
Architecture: i386
Source: glibc
Version: 2.7-18lenny4
Replaces: man-db (<= 2.3.10-41), gettext (<= 0.10.26-1), ppp (<= 2.2.0f-24), 
          libgdbmg1-dev (<= 1.7.3-24)
Provides: libc-dev
Depends: libc6 (= 2.7-18lenny4), linux-libc-dev
Recommends: gcc | c-compiler
Suggests: glibc-doc, manpages-dev
Conflicts: libstdc++2.10-dev (<< 1:2.95.2-15), gcc-2.95 (<< 1:2.95.3-9), 
           binutils (<< 2.17cvs20070426-1), libc-dev
Filename: pool/updates/main/g/glibc/libc6-dev_2.7-18lenny4_i386.deb
Size: 3387248
MD5sum: 9cdb8401cead8afdd9f3e5da7bf673f8
SHA1: 01049f981a24dc0e5da8a3a1e57a8f2e91d7e57a
SHA256: 89c222ece39c417ee91f24d9f5619f58be330b111092379e4f09b93bcbfe834b
Description: GNU C Library: Development Libraries and Header Files
 Contains the symlinks, headers, and object files needed to compile
 and link programs which use the standard C library.
Build-Essential: yes
Tag: devel::lang:c, devel::library, implemented-in::c, role::devel-lib, suite::gnu

edd@mccoy:~$ 
Dirk Eddelbuettel
I tried to find it after reading your answer. But I can't figure out where to look. I am new to Linux source code stuff. I would appreciate if you could point me to a link.
bits
A Google search for "gnu libc source code" (no quotes) will lead you straight to the official site: http://www.gnu.org/software/libc/#Availability
David Zaslavsky
Besides David's helpful answer, there is also source code for libc6 in whichever Linux distro you use -- for me it is as easy as `apt-get source libc6`.
Dirk Eddelbuettel
Thanks guys, First of all I didn't know that pthreads is a part of glibc. So... now I know. Secondly, following David's suggestion, I downloaded the linuxthreads tarball from http://ftp.gnu.org/gnu/glibc/And that is helping me learn better.But I would love it more if I have a website where I can browse all this code.
bits
Dirk, Thanks for your suggestion as well. Unfortunately, I am living on windows to learn linux. But I will use that command to get libc6 source as soon as I am on linux env.For now, I am looking for an easy to browse website.
bits
Please note that linuxthreads is the old implementation of threads. The new one is called NPTL and should be in the normal glibc tarballs.
ninjalj
+1  A: 

http://gnunet.org/doxygen/html/pthread_8c-source.html

http://www.opengroup.org/onlinepubs/009695399/basedefs/pthread.h.html

http://code.google.com/p/pthread-lib/source/browse/trunk/pthread-lib/src/ptl_array_list.c

eruciform
Oh perfect. That is what I was looking for.But if anyone else comes across more links, please do post.
bits
+1  A: 

pthreads are implemented on Linux in libc. The usual libc is glibc - the glibc pthreads implementation is called NPTL, and the source is available in gitweb.

caf