Re: User-level threads and preemption

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

 



>>>>> "Sridhar" == Sridhar N <<srin@symonds.net> (by way of Sridhar N <srin@srin.homelinux.net>)> writes:

Sridhar> 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.

Sridhar> Sorry, i suppose i didn't say it right.  I wasn't talking about the threads
Sridhar> that you create using a system call ( eg. clone() ), but i was referring to
Sridhar> user-space libs ( like pthread,etc, )

_Usually_ it is not possible, as the kernel is unaware of the
existance of some user space date structures, which the user use to
call "threads" ;). Thus, a blocked userspace thread blocks the entire
process. In GNU/Linux that's the case with GNU Pth, as they are pure
userspace, unlike Linuxthreads, which are pure kernelspace.

Why "usually" ? :)

Because there are systems, where the userland is notified when a
thread is put to sleep, thus given the chance to run another one. This
is usually called "scheduler activations" with the most notable (or of
most practical interest) example being the upcoming FreeBSD 5.0
kernel.

Regards,
-velco
--
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