[Top] [All Lists]

Re: mapping a userspace thread to a kernelspace thread

To: "Suprasad Mutalik Desai" <>, <>
Subject: Re: mapping a userspace thread to a kernelspace thread
From: "Kevin D. Kissell" <>
Date: Fri, 28 Sep 2007 08:08:32 +0200
Original-recipient: rfc822;
References: <>
You seem to be laboring under a misconception or two, here.  NPTL is a 1:1 
model (it would have been damned convenient for me for it not to have been).  
linuxthreads and NPTL will create a native, known-to-the-kernel thread, which 
is what
I think you mean by a "kernel thread", in response to a pthread_create().  The 
new thread
will start life on the same CPU that created it, but normal load balancing will 
migrate it elsewhere pretty quickly.  If you want to manage thread->CPU binding
explicitly, the sys_sched_setaffinity() system call can be used.


            Kevin K.

----- Original Message ----- 
From: "Suprasad Mutalik Desai" <>
To: <>
Sent: Friday, September 28, 2007 7:23 AM
Subject: mapping a userspace thread to a kernelspace thread

> Hi list ,
>             I want to know how can we map a userspace thread to a
> kernel thread as mentioned in 1:1 threading model (linuxthreads) or
> M:N model (NPTL)  . Does this happen by just calling a
> pthread_create() in the userspace program or i need to do something
> more in the kernel space . i am using 2.6.20 kernel  .
>        I want to use this for multi threading operation in a SMP
> environment where in i want to schedule a userspace program on another
> processor by spawning a thread  . Can anyone help me in this.
> Thanks and regards,
> Suprasad.

<Prev in Thread] Current Thread [Next in Thread>