In a multiprogramming system, multiple processes are kept in memory at the same time. When a process has to wait for I/O, the OS takes the CPU away from that process and gives it to another process. This is called CPU Scheduling.
Different CPU scheduling algorithms have different properties. The criteria used for comparing these algorithms include:
By far the simplest CPU scheduling algorithm. The process that requests the CPU first is allocated the CPU first. It is implemented using a FIFO queue.
Associates with each process the length of its next CPU burst. When the CPU is available, it is assigned to the process that has the smallest next CPU burst.
Designed specifically for time-sharing systems. It is similar to FCFS scheduling, but preemption is added to switch between processes. A small unit of time, called a Time Quantum (or time slice), is defined.
The CPU scheduler goes around the ready queue, allocating the CPU to each process for a time interval of up to 1 time quantum.
A priority is associated with each process, and the CPU is allocated to the process with the highest priority. Equal-priority processes are scheduled in FCFS order.