Help for graduate research - how are NLTP routines implemented at the OS level

Carlos O'Donell
Wed Mar 23 12:46:00 GMT 2011

On Sat, Mar 19, 2011 at 6:32 PM, Mike Frysinger <> wrote:
> On Saturday, March 19, 2011 17:46:18 Edmon Begoli wrote:
>> I need help understanding what system calls are used to implement
>> mutexes and context switches.
> you probably want to google futexes.  drepper wrote some stuff on it too iirc.
> try
> in fact, simply googling for "nptl design" shows some good hits.
>> I am interested in knowing specifically how is pthread_mutex_lock and
>> unlock implemented and what OS system calls are used for context
>> switching (longjmp/setjmp?).
> there arent any syscalls used for context switching, and certainly not
> setjmp/longjmp.  the threads are handled by the linux kernel.

Just for some more context.

The Linux kernel and GLIBC have a 1:1 threading model. There are M
kernel threads that match up with M userspace threads.

Unlike for example, Solaris whose historical default has been an M:N
implementation where multiple user threads were tied to one kernel
process, which is scheduled by the kernel.

IIRC anything newer than Solaris 8/9 can use a 1:1 model, and it's is
the preferred model.

For a whitepaper about the change see:


More information about the Libc-help mailing list