Subject: Re: selwakeup()
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 03/03/2002 21:18:32
On Sun, Mar 03, 2002 at 05:31:30AM +0100, Hubert Feyrer wrote:
> On Thu, 28 Feb 2002, Martin Husemann wrote:
> > > unsuccessful so far. Does anyone know whether this function causes
> > > or schedules a context switch to the process being woken up?
> > 
> > It marks processes blocked in a select() or poll() call for the thing
> > in the selinfo parameter runnable. This may involve a call to wakeup(),
> > if multiple processes are waiting.
> > 
> > The scheduler may pick one of the now runnable processes the next time it is
> > doing a context switch. AFAICT there is no imediate switch to the process
> > enforced.
> 
> Maybe some comment can be added to sys/kern/sys_generic.c ?
> 

Am I correct in my belief that netbsd only does a process switch
if either:
1) a process blocks itself
or
2) a higher priority process is runnable on the return to
   user space (system call or ISR return).

So that the behaviour of selwakeup (etc) is not special....

Certainly some chunks of kernel code do not allow for arbitrary
pre-emption of processes.

(The SVR4 kernel was changed to allow process pre-emption at any
time as part of the SMP work).

	David

-- 
David Laight: david@l8s.co.uk