Re: User-level threads and preemption

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

 



On Tue, Apr 23, 2002 at 06:51:42AM +0530, Sridhar N wrote:
> On Monday 22 April 2002 05:02 am,  Erik Mouw wrote:
> > > 	If one userspace thread is doing a system call and is pre-empted, can
> > > the process execute another of its own thread  that also executes a
> > > system call ?
> >
> > Sure, why not? Threads and processes are almost the same on linux, so
> > if a process can be preempted, a thread can also be preempted.
> 
> Sorry, i suppose i didn't say it right.  I wasn't talking about the threads
> that you create using a system call ( eg. clone() ), but i was referring to
> user-space libs ( like pthread,etc, )

The pthread library in linux is just a wrapper around the clone()
system call, so the threads are preempted if they are in kernel space.

If threads are done completely in userland (like Sun Slowaris), the
threads are running within a process, and which can also be preempted.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux