5.2 Threading Model

The GNU C library (glibc) implements Pthreads as the Native POSIX Threads Library (NPTL), where each thread maps to a kernel scheduling entity. The original Pthreads implementation Linux threads is not supported from glibc 2.4 onward. If an application depends on Linux threads being present, you must modify it to use NPTL.

Compared with LinuxThreads, NPTL provides closer conformance to the requirements of the POSIX.1 specification and better performance for large numbers of threads. NPTL has been available from glibc 2.3.2 onward and requires features that are present in the 2.6 and later kernels.

For glibc 2.3.2 and later, you can use the getconf command to determine the threading implementation:

# getconf GNU_LIBPTHREAD_VERSION
NPTL 2.12

With older glibc versions, use a command such as the following to determine the default threading implementation:

# $( ldd /bin/ls | grep libc.so | awk '{print $3}' ) | egrep -i 'threads|nptl'
	Native POSIX Threads Library by Ulrich Drepper et al