On Mon, 18 Feb 2002, Matthew Dillon wrote:

> :
> :I can't see any major problem with this but I can't help thinking that
> :there must be one.. on UP the question is: "who is going to 
> :release the lock if no-one is runnable?"
>     An interrupt, of course.  Wakeups don't happen out of thin air!  This
>     is true of 1.x, 2.x, 3.x, 4.x, 5.x, UP, and SMP.  Something needs to
>     trigger the event that causes the wakeup to occur.
> :can you detail in more clarity the flip-flopping you were seeing?
>     Basically what is happening is that switch/wakeup overhead is being
>     imposed unnecessarily.  There is no need to switch if there is nothing
>     to switch to, and this also causes the other process to not have to
>     wakeup anyone when it releases Giant because process #1 is spinning
>     on it instead of sleeping on it.  So you immediate remove four context
>     switches from the critical path.

true, though the original code would halt the processor to reduce power
consumption on laptops etc. procrunnable doesn't include the idle
process. (a side-effect).


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to