Processor Scheduler

Definition

When seen by its own, the execution of a process is an alternate sequence of two type of periods:

  • CPU burst – executing CPU instructions.

  • I/O burst – waiting for the completion of an I/O request.

Based on this, a process can be classified as:

  • I/O-bound – if it has many short CPU bursts.

  • CPU-bound (or processor-bound) – if it has (few) long CPU bursts.

The idea behind multiprogramming is to take advantage of the I/O burst periods to put other processes using the CPU.

The processor scheduler is the component of the operating system responsible for deciding how the CPU is assigned for the execution of the CPU bursts of the several processes that coexist in the system.

Levels in processor scheduling

Long-term scheduling

Determines which programs are admitted for processing.

  • Controls the degree of multiprogramming.

  • If admitted, a job or user's program 'becomes' a process and is added to the queue of ready processes (typically in the short-term scheduler, but also possible in the medium-term scheduler.

Medium-term scheduling

Manages the swapping area.

  • swapping-in decision is based on the degree of multiprogramming.

  • memory management can also condition swapping-in operation.

Short-term scheduling

Decides which process executes next.

  • It is invoked whenever an event occurs that blocks the current process or allows to preempt it.

  • Possible events: clock interrupt, I/O interrupt, system call, signal (e.g semaphore).

Last updated