]> Devi Nivas Git - cs3210-lab0.git/commit
Final word on the locking fiasco?
authorrsc <rsc>
Thu, 27 Sep 2007 21:25:37 +0000 (21:25 +0000)
committerrsc <rsc>
Thu, 27 Sep 2007 21:25:37 +0000 (21:25 +0000)
commitab08960f6402f5c7cbb7b6e81694a60b6abed4c8
tree156a197126bdfb99bb5081b7fe78ee3e8528aa5b
parentf97f0d2b3d3afbad3ef154b047f1b0408fd7288b
Final word on the locking fiasco?

Change pushcli / popcli so that they can never turn on
interrupts unexpectedly.  That is, if interrupts are on,
then pushcli(); popcli(); turns them off and back on, but
if they are off to begin with, then pushcli(); popcli(); is
a no-op.

I think our fundamental mistake was having a primitive
(release and then popcli nee spllo) that could turn
interrupts on at unexpected moments instead of being
explicit about when we want to start allowing interrupts.

With the new semantics, all the manual fiddling of ncli
to force interrupts off in certain sections goes away.
In return, we must explicitly mark the places where
we want to enable interrupts unconditionally, by calling sti().
There is only one: inside the scheduler loop.
main.c
proc.c
proc.h
spinlock.c
trap.c