Subject: Re: smp status -- more details..
To: None <>
From: Paolo Losi <>
List: tech-smp
Date: 08/22/2000 11:55:50
Sorry for the dumb question....  I'm trying to learn fast
and I need some help :=)

> Synchronization:
> The traditional UNIX synchronization model uses wakeup() and sleep();
> [BSD4.4 added tsleep(), which takes an additional timeout parameter.]
> In the example pseudo-code:
>         while (queue is empty)
>                 sleep(&queue);
> there is a small window between when the queue is checked and when the
> proces goes to sleep.  In the traditional UNIX uniprocessor model, the
> kernel is scheduled cooperatively, so the above code is safe -- no
> other process could get in sideways before the slep.

What happens in the uniprocessor case if, during  that time window,
you get an interrupt that fills the queue?
I think you cannot protect the queue raising IPL because 
in that case you're going to sleep with interrupts disabled.

P.S. I'm reading the 4.4BSD Design and Implementation book.
It would be really appreciated as an answer a section reference
in that book or just a pointer to some NetBSD code to look at