can "wantin" ever be non-zero? (source licensee's only)

Luigi Semenzato luigi at hplabs.UUCP
Fri Jul 29 03:40:08 AEST 1983


I was looking at the 4.1BSD "scheduler" (sched(), in vmsched.c), 
and I found out that it spends most of the time sleeping on 
either of two events: "lbolt" or "runout", depending whether 
"wantin" is set or not.  The only place in which wantin is set is 
in setrun() (or the equivalent part of wakeup()): if the process 
to be run is not in memory, wantin is set.  Also, if the 
scheduler was sleeping on runout ("nothing to do, wake me up when 
you need me") setrun() performs a wakeup() on runout.  

It seems like the other sleep in sched() is of the type "I know 
there is a process that wants to be brought in, but it doesn't 
have enought priority right now, so I'll sleep for a while and 
try again".  Well, the problem is: every time sched() goes to 
sleep, when it wakes up the first thing it does is clearing 
wantin.  Why does it do that?  Does it EVER go to sleep on 
lbolt?  If yes, how?  I am confused.  

-- 
	Luigi Semenzato	    HP Labs     Palo Alto, CA 94304



More information about the Comp.unix.wizards mailing list