3.3. The Process SchedulerΒΆ

We define process scheduling as:

The act of determining which process in the ready state should be moved to the running state. That is, decide which process should run on the CPU next.

The goal of the scheduler:

Implement the virtual machine in such a way the user perceives that each process is running on it’s own computer.

Modern operating systems are generally able to achieve this because of the statistical properties of processes. Over a short period, processes can be categorized according to what is limiting the completion of the process.

I/O Bound Process
  • Processes that are mostly waiting for the completion of input or output (I/O) are I/O Bound.
  • Interactive processes, such as office applications are mostly I/O bound the entire life of the process. Some processes may be I/O bound for only a few short periods of time.
  • The expected short run time of I/O bound processes means that they will not stay the running the process for very long.
  • They should be given high priority by the scheduler.
CPU Bound Process
  • CPU Bound processes are ones that are implementing algorithms with a large number of calculations.
  • They can be expected to hold the CPU for as long as the scheduler will allow.
  • Programs such as simulations may be CPU bound for most of the life of the process.
  • Users do not typically expect an immediate response from the computer when running CPU bound programs.
  • They should be given a lower priority by the scheduler.

Schedulers fall into one of two general categories:

  1. Non-preemptive scheduling

    when the currently executing process gives up the CPU voluntarily.

  2. Preemptive scheduling

    when the operating system decides to favor another process, preempting the currently executing process.


Contents