wakeup() race condition. (theory)

pri=-10 Stuart Lynne sl at van-bc.UUCP
Sat Nov 26 20:52:03 AEST 1988


In article <14722 at mimsy.UUCP> chris at mimsy.UUCP (Chris Torek) writes:
>In article <1974 at van-bc.UUCP> sl at van-bc.UUCP (pri=-10 Stuart Lynne) writes:
>>This problem does exist when writing drivers under SCO Xenix. ...
>>SCO's line discipline routines protect things at spl5. While serial interrupts 
>>are handled at spl7 and the clock (and all poll routines) run at spl6.
>
>This is grotesque.  There are three `good' ways to fix it:

I agree. I didn't say I liked it. Thats the way that it works on the (almost
current) version of SCO 286/386 that I've been working with.

Unfortunately you're stuck with being unable to change the spl protection in
the line discipline routines, or safely changing the interrupt level of the
clock (and therefore poll) and if you want to ensure that you don't loose
serial interrupts, running them at spl7.

By rights SCO's scheme as designed would work well if they simply raised the
spl level in the line discipline routines to spl6. And you make the
assumption/design criteria the the interrupt routines don't access any
shared data strutures. I.e. for serial drivers only filling/emptying a
private ring buffer. 

In point of fact even as is the end result is pretty bomb proof if inelegant
and slightly inefficent.


-- 
Stuart.Lynne at wimsey.bc.ca {ubc-cs,uunet}!van-bc!sl     Vancouver,BC,604-937-7532



More information about the Comp.unix.wizards mailing list