> The one thing which the BSD implementations have that we *don't* have is
> the ability mask just one kind of interrupts (say, serial or networking
> interrupts) during some critical section of code. The only thing we can
> do is use cli(), which blocks all interrupts.
> So one of the things which the BSD networking stack can do is to (in
> some critical section of code), prevent network interupts from being
> handled. If a network interrupt comes in during the critical section of
> code, it is queued, and would be executed only after the networking code
> had unblocked network interrupts. (However, if a disk interrupt
> happened during the critical section, it would be handled.)
The trouble is that on the x86, disabling just some interrupts means
you have to talk to the interrupt controller, which is excessively
There was a paper by Chris Small a couple of years ago that suggested
that the best thing to do (on the x86, anyway) was to use cli/sti for
small critical sections and talk to the interrupt controller only if
you were going to have interrupts off for a good while.
I can dig up the exact reference if you like, or you should be able to
find it under http://www.eecs.harvard.edu/~chris.
- David A. Holland | (please continue to send non-list mail to
[email protected] | [email protected]. yes, I moved.)
Any netkit mail should be sent to [email protected], not me.