Re: Process scheduling.

Greg Hewgill (gregh@lightspeed.net)
Mon, 9 Jun 1997 22:42:28 -0700


> From: Trent Piepho <xyzzy@u.washington.edu>
> There are some flaws with a strict priority system like this. Say an
> application program has locked a file that a server process needs. The
> application will never get any cpu time and will never unlock the file.
Thus
> it is effectivly preventing the higher priority server process from
running.

This is addressed in many scheduling algorithms by a technique called
"priority inversion" or "priority inheritance". The OS can tell when a high
priority process is waiting for a lower priority one to finish. When this
happens, it temporarily boosts the priority of the process holding the lock
to the same (or even higher) priority than the process that is waiting. This
prevents starvation and allows the waiting higher priority process to
continue as soon as possible. Of course after the waiting process is
released, the lower priority process gets kicked back down to where it was in
the first place.