Scheduling

Scheduling is an important part of an OS. The goal of scheduling is to divide limited resources among users, processes, or anything for that matter. In this way a scheduler's role can be akin to that of a "glorified bouncer."

There are three types of scheduling: long term scheduling, medium term scheduling, and short term scheduling. For instance, a long term scheduler that deals with processes determines which processes are admitted into a system; a medium term scheduler determines which processes reside in RAM and which in stable storage; and a short term scheduler determines which process currently is using the CPU.

Scheduling Metrics

In a scheduler that deals with processes, for instance, the wait time is defined as the time between the start of the parent process and the execution of the child process. The response time is the time it takes to obtain the first output from the child process in addition to the wait time. The turnaround time is is the time it takes for the child process to finish in addition the the wait time. The turnaround time is also called latency.

One of a scheduler's performance goals is to minimize the response time and turnaround time. Depending on the purpose, sometimes a minimal response time is prioritized; other times the turnaround time is more important. For instance, a web browser might emphasize a small response time over a small turnaround time.

Two other factors used to evaluate scheduling performance are utilization and throughput. Utilization is the percent of time the CPU is doing useful work. Throughput is the rate of useful work being done.

The overall goal of scheduling performance is to minimize turnaround time and the response time and to maximize utilization and throughput. Unfortunately, these goals may sometimes conflict with each other.