Re: kernel threads

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

 



On Thu, Jul 01, 2004 at 11:27:37 +0530, aksingh@hss.hns.com wrote:
> So one shoudl use kernel threads if you want to do something during which
> you can sleep, correct ?(this is what you mean by using it in process
> context and not syscall). So if kernel threads are the same as a process

You definitely CAN sleep when handling a syscall. So it's really when
you need to be able to sleep, but don't have the syscall to call you.
For example a NFS server has several threads, that wait for network
request to come in and respond to them. But NFS client does not have any
threads, because the waiting is done on behalf of the process, that
wants something (ie. called open, read, mkdir etc...).

> then we can probably add them to a wait_queue and scheule them using
> schedule() ?, we can use wait functions like wait_event_interruptible on
> those, right ?

Right.

With a small note on signals -- there are no signal handlers within
kernel, so you have to check for signal_pending() and act acoordingly
whenever you wake up. Or you can mask the signals, of course.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[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