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

Lennart Sorensen
2005-05-20T20:13:00Z

On Fri, May 20, 2005 at 06:13:48PM +0000, 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.

Well so far my tests show that glibc 2.3.2.ds1-21 on Debian Sarge when
running 2.6.11 kernel on i386 uses LinuxThreads, while on amd64 version
of Sarge it uses NPTL (and won't run with 2.4 kernel at all either).

Maybe Debian compiled their glibc to not do NPTL on i386 yet. Not sure.

Hmm, after checking, it turns out if you use errno in your program, it
drops to linuxthreads, while using #include <errno.h> makes it able to
use NPTL when using 2.6 kernel. Now my program works the same on i386
as on amd64 (I had to fix the errno to make it run on amd64 so that does
make some sense). Well I learned something new.

Len Sorensen