Re: Thread and process dentifiers (CPU affinity, kill)

Olivier Croquette
2005-05-20T20:19:39Z

Miquel van Smoorenburg wrote:

> No. On modern systems, glibc contains both LinuxThreads and NPTL.
> They have the same ABI. At runtime one of the two is selected,
> depending on if the currently running kernel supports NTPL.
> You can also force it by setting the LD_ASSUME_KERNEL environment
> variable to 2.4 or 2.6.

More info about that from:
http://linuxdevices.com/articles/AT6753699732.html

Some Linux vendors, such as later versions of Red Hat Linux, have
backported NPTL to earlier kernels and have even made the threading
environment for specific processes selectable through an environment
variable (LD_ASSUME_KERNEL). On systems that support this feature, the
variable is set via a command such as the following:
# export LD_ASSUME_KERNEL=2.4.1
This is a clever way to enable some existing applications that rely on
LinuxThreads to continue to work in an NPTL environment, but is a
short-term solution. To make the most of the design and performance
benefits provided by NPTL, you should update the code for any existing
applications that use threading.

[...]

Simply using a 2.6 based kernel does not mean that you are automatically
using the NPTL. To determine the threading library that a system uses,
you can execute the getconf command (part of the glibc package), to
examine the GNU_LIBPTHREAD_VERSION environment variable, as in the
following command example:
# getconf GNU_LIBPTHREAD_VERSION
linuxthreads-0.10
If your system uses the NPTL, the command would return the value of NPTL
that your system was using, as in the following example:
# getconf GNU_LIBPTHREAD_VERSION
nptl-0.60