unix & real time -- is a rewritten UNIX still UNIX?

Bill Shannon shannon at sun.uucp
Wed Nov 14 06:57:08 AEST 1984


To most people, real-time means guaranteed maximum response time to
interrupts.  With UNIX's use of spl's to provide critical sections,
it is hard enough just reducing the time spent at high priority,
let alone guaranteeing that you'll only be at high priority for
some maximum time considering all the possible unanticipated
combinations of critical sections calling critical sections being
interrupted by higher priority devices calling who knows what.
Everyone has to cooperate to keep the interrupt response time as
low as possible.  Right from the start UNIX is not cooperating.

A good example of real-time requirements in many newer UNIX systems
is being able to handle 9600 baud asynchronous input with little or
no hardware buffering.  On the Sun our approach to guaranteeing that
we could service the interrupt as soon as possible was to make the
UARTs interrupt at a priority higher than the system used for anything
else, even the clock.  The interrupt routine does the absolute minimum
amount of processing, just reading the character and saving it away
in a buffer in memory and triggering a software interrupt at a lower
priority to actually process the character.

VMS takes a similar, but more general, approach to the problem.  On
VMS the interrupt routines save away only the absolute minimum amount
of state for the device and reschedule a lower priority "process" to
handle the interrupt.

It's often possible to construct a special version of UNIX to solve
a specific real-time problem but it's much more work to restructure
the system so that a general solution to a whole class of real-time
problems is possible.

					Bill Shannon



More information about the Comp.unix.wizards mailing list