Skip to main content
1 of 10
FooF
  • 685
  • 6
  • 9

The book you are reading describes the world according to the first historical implementation of POSIX threads on Linux, called LinuxThreads (see also Wikipedia article for some).

LinuxThreads had some compatibility issues with POSIX standard and some other serious issues. To fix these problems, another implementation called NPTL (Native POSIX Thread Library) was spearheaded by Red Hat and eventually incorporated into GNU C Library (taking good parts from yet another competing reimplementation project by IBM called NGPT ("Next Generation Posix Threads"), see Wikipedia article on NPTL). Still nowadays some embedded Linux SDKs use this implementation relic (this is because they are using smaller memory footprint version of LibC that took some time to port the work from GNU LibC. This can be observed by noticing that indeed PIDs for different threads on those platforms are also different unlike the POSIX standard specifies exactly like the book you are reading says. Actually once you called pthread_create() you suddenly had increased the process count from one to three as additional process was needed to keep the mess together.

The Linux pthreads(7) manual page provides a comprehensive and interesting overview of the differences between the two. Another enlightening, though out-of-date, description of the differences is this paper by Ulrich Depper and Ingo Molnar about the design of NPTL.

FooF
  • 685
  • 6
  • 9