4.2 Process scheduling


The goal of the process schedule is to maximize the CPU utilization by switching CPU among the processes.

Scheduling queues
When a process needs to be executed, it moves from the secondary storage to the main-memory. They are put into a job queue. The processes that are ready to be executed are kept in the ready queue. The ready queue is implemented as a linked list which points to the first PCB in the list.

Schedulers
The scheduler is the operation that the operating system performs to migrate the process among the different scheduling queues. There are two types of schedulers which are:
The long-term scheduler (job scheduler). It selects the processes from the secondary storage and loads
them into the main-memory. It controls the degree of multiprogramming (the number of processes in
memory).
The short-term scheduler (CPU scheduler). It selects among the ready processes and allocates one of
them to CPU.

There are two types of processes which are:
An I/O-bound process that spends more of its time doing I/O than it spends doing computations.

4.2 Process scheduling


A CPU-bound process that generates I/O requests infrequently and uses more of its time doing
computations.

It is the job of the long-term scheduler to mix of I/O-bound and CPU-bound processes to have the best performance.

Context switch
The context switch is the task of switching the CPU to another process which requires saving the state of the old process and loading the saved state of the new process.