What is the basic difference between NPTL and POSIX threads? How have these two evolved?
POSIX threads (pthread) is not an implementation, it is a API specification (a standard, on paper, in english) of several functions whose name starts with pthread_
and which are defined in
header. POSIX is also a set of specifications.
NPTL is now inside GNU Libc on Linux and is (or at least tries very hard to be) an implementation of POSIX threads. It is a bunch of source and binary code on your Linux system.
An application compiled with gcc -pthread
and linked with -pthread
uses NPTL code on Linux today.
There exist alternative implementations of pthread
-s: on Linux, the MUSL Libc aims to be Posix compliant (which means having pthreads); on other Posix systems (AIX, Solaris, ...) you also have pthreads (but they are not NPTL or Glibc).