Nice

Richard M. Mathews richard at locus.com
Fri Feb 1 07:32:41 AEST 1991


jackv at turnkey.tcc.com (Jack F. Vogel) writes:
>boyd at necisa.ho.necisa.oz.au (Boyd Roberts) writes:
>>richard at locus.com (Richard M. Mathews) writes:
>>>...  In many (most?) versions of Unix if an interrupt
>>>makes a process runnable at a higher priority than the running process,
>>>a context switch will be forced immediately.
> 
>>No, UNIX does not have pre-emptive scheduling.  When the above event occurs
>>the kernel context switches at the next user-mode trap, system call, sleep()
>>or the once-a-second context switch (time quantum expiry).
> 
>What will happen is that the
>interrupt will cause the kernel to run in trap(), there it will do whatever
>serving needs to be done

Thanks for the defense, Jack.  To be explicit, look for the call to
aston() in wakeup() in a VAX kernel.  This will cause a trap to occur
before ANY user mode instructions are executed; that is what I meant by
"immediately".  Before that trap returns to user mode, it will notice
runrun is set and reschedule.  In other systems (such as a few different
80*86 kernels I've seen) both traps and interrupts check runrun before
returning to user mode and can switch context immediately.

Richard M. Mathews			 Freedom for Lithuania
richard at locus.com				Laisve!
lcc!richard at seas.ucla.edu
...!{uunet|ucla-se|turnkey}!lcc!richard



More information about the Comp.unix.internals mailing list