Scheduling Algorithms Survey
Scheduling Algorithms Survey
Need of scheduling:
A typical process involves both I/O time and CPU time. In a uni-programming system like MS-
DOS, time spent waiting for I/O is wasted and CPU is free during this time. In multi
programming systems, one process can use CPU while another is waiting for I/O. This is
possible only with process scheduling.
Types of Schedulers:
Long-term Scheduler
The long-term or admission scheduler decides which jobs or processes are to be admitted
to the ready queue; this scheduler dictates what processes are to run on a system, and the
degree of concurrency to be supported at any one time.
Medium-term Scheduler
The mid-term scheduler temporarily removes process from main memory and place them
on secondary memory (such as a disk drive) or vice versa. referred to as “swapping of
processes out" or "swapping in" (also incorrectly as "paging out" or "paging in").
Short-term Scheduler
The short-term scheduler (also known as the CPU scheduler) decides which of processes
in the ready queue, in memory are to be executed (allocated a CPU). short-term scheduler
makes scheduling decisions much more frequent than the long-term or mid-term
schedulers. This scheduler can be preemptive
Shortest Job First (SJF): Process which have the shortest burst time are scheduled first.
If two processes have the same bust time then FCFS is used to break the tie.
It is a non-preemptive scheduling algorithm.
1. FCFS can cause long waiting times, especially when the first job takes too much CPU
time.
2. Both SJF and Shortest Remaining time first algorithms may cause starvation. Consider
a situation when the long process is there in the ready queue and shorter processes keep
coming.
3. If time quantum for Round Robin scheduling is very large, then it behaves same as
FCFS scheduling.
4. SJF is optimal in terms of average waiting time for a given set of processes, i.e., average
waiting time is minimum with this scheduling, but problems are, how to know/predict the
time of next job.
Verdict:
From the above discussion it is clear that First Come First Serve (FCFS) & Shortest Job
First (SJF) is generally suitable for batch operating systems
Round Robin (RR) & Priority Scheduling (PS) is suitable for time sharing systems.
No algorithm is optimum for all type of jobs.