Re: mapping a userspace thread to a kernelspace thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You seem to be laboring under a misconception or two, here.  NPTL is a 1:1 threading
model (it would have been damned convenient for me for it not to have been).  Both
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 generally
migrate it elsewhere pretty quickly.  If you want to manage thread->CPU binding
explicitly, the sys_sched_setaffinity() system call can be used.

            Regards,

            Kevin K.

----- Original Message ----- 
From: "Suprasad Mutalik Desai" <suprasad.desai@xxxxxxxxx>
To: <linux-mips@xxxxxxxxxxxxxx>
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.
> 
> 


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux