Process management

Time-sharing class and fixed class

The goal of the time-sharing policy is to provide good response time to interactive processes and LWPs and good throughput to CPU-bound processes and LWPs. The scheduler switches CPU allocation frequently enough to provide good response time, but not so frequently that it spends too much time doing the switching. Time slices are typically a few hundred milliseconds.

The time-sharing policy changes priorities dynamically and assigns time slices of different lengths. The scheduler raises the priority of an LWP that sleeps after only a little CPU use (an LWP sleeps, for example, when it starts an I/O operation such as a terminal read or a disk read); frequent sleeps are characteristic of interactive tasks such as editing and running simple shell commands. On the other hand, the time-sharing policy lowers the priority of an LWP that uses the CPU for long periods without sleeping.

The default time-sharing policy gives larger time slices to LWPs with lower priorities. An LWP with a low priority is likely to be CPU-bound. Other LWPs get the CPU first, but when a low-priority LWP finally gets the CPU, it gets a bigger chunk of time. If a higher-priority LWP becomes runnable during a time slice, however, it preempts the running process or LWP.

The scheduler manages time-sharing processes and LWPs using configurable parameters in the time-sharing parameter table ts_dptbl. This table contains information specific to the time-sharing class.

The default fixed class policy is similar to the default time-sharing policy except that the priorities and time slices given to fixed class processes or LWPs do not degrade over time. The fc_dptbl parameter table contains information specific to the fixed class.

Next topic: System class
Previous topic: The UNIX System V Release 4 process scheduler

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004