Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Source code of PThread Library? [closed]

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.

like image 530
bits Avatar asked Jul 11 '10 18:07

bits


People also ask

Where can I find pthread library?

There are a number of ways to find this out. Simply type find / -name 'libpthread.so' -print to find the file named libpthread.so on your system. You can check the library locations your dynamic linker ld checks in for libraries, which are listed in /etc/ld.

Is pthread part of glibc?

The recent 2.34 release of the GNU C library, glibc, removes libpthread as a separate library. This article explains the motivation behind this change and some consequences for developers and system administrators.

Are pthreads still used?

Yes, the pthreads library is still used for threading. There are some higher level libraries (boost, or if you have a c++ 11 compliant compiler, the standard library) that will also give you threading capabilities, although for somethings you will still need to fall back to the plain pthread call.

How do I add a pthread library code to Visual Studio?

For NuGet packages, please launch Visual Studio 2017 and select your project > right-click your project > choose Manage NuGet Packages… > Browse > search and find pthreads > Install.


2 Answers

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.

like image 187
caf Avatar answered Sep 28 '22 09:09

caf


You can find the source at both of these links:

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

like image 38
eruciform Avatar answered Sep 28 '22 08:09

eruciform