Subject: Re: Is the netBSD kernel Preemptible ?
To: Gary Thorpe <gat7634@hotmail.com>
From: Lars Heidieker <lars@heidieker.de>
List: tech-perform
Date: 06/14/2002 19:23:14
Gary Thorpe wrote:

> >From: Matt Thomas <matt@3am-software.com>
> >To: tech-perform@netbsd.org
> >Subject: Re: Is the netBSD kernel Preemptible ?
> >Date: Thu, 13 Jun 2002 20:41:15 -0700
> >
> >At 04:34 PM 6/13/2002, David Francheski wrote:
> >>Can anybody tell me if the netBSD kernel itself is preemptible?
> >>By this I mean can a context-switch to a higher priority process
> >>occur while in kernel mode?
> >
> >The kernel is not currently preemptible.
> >
> >
> >--
> >Matt Thomas               Internet:   matt@3am-software.com
> >3am Software Foundry      WWW URL:   http://www.3am-software.com/bio/matt/
> >Cupertino, CA             Disclaimer: I avow all knowledge of this message
>
> Hi,
>
> Just a quick question: what does tsleep() do? It says it lets the current
> process sleep or something in the man page, but when used in the kernel,
> does it allow another process to enter the kernel? For example, say you have
> a device driver and a user application does a read() which eventually ends
> up calling methods for this device. Say also that the driver has to wait for
> an interrupt to occur: if tsleep() is called for this, can another
> thread/process then enter the kernel?
>

Yes other threads/tasks can enter the kernel while "others" sleep because of
calling tsleep.
But (in kernel) a thread/task has to give up its timeslice on its own decision
(calling tsleep),
its not forced of the cpu, that happens if the thread leaves the kernel again.

Lars

>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com

--
Mystische Erklärungen.
Die mystischen Erklärungen gelten für tief;
die Wahrheit ist, daß sie noch nicht einmal oberflächlich sind.
                --Friedrich Nietzsche