First-Come First-Served Scheduling (FCFS) : Turnaround Time Waiting Time + Service Time
First-Come First-Served Scheduling (FCFS) : Turnaround Time Waiting Time + Service Time
Advantages
Disadvantages
Convoy effect occurs. Even very small process should wait for its
turn to come to utilize the CPU. Short process behind long process
results in lower CPU utilization.
Throughput is not emphasized.
This algorithm associates ith each process the length of the next CPU
burst. Shortest-job-first scheduling is also called as shortest process next
(SPN). The process with the shortest expected processing time is
selected for execution, among the available processes in the ready
queue. Thus, a short process will jump to the head of the queue over
long jobs. If the next CPU bursts of two processes are the same then
FCFS scheduling is used to break the tie.SJF scheduling algorithm is
probably optimal. It gives the minimum average time for a given set of
processes. It cannot be implemented at the level of short term CPU
scheduling. There is no way of knowing the shortest CPU burst.
SJF can be preemptive or non-preemptive.
A preemptive SJF algorithm will preempt the currently executing process
if the next CPU burst of newly arrived process may be shorter than what
is left to the currently executing process.
A Non-preemptive SJF algorithm will allow the currently running process
to finish. Preemptive SJF Scheduling is sometimes called Shortest
Remaining Time First algorithm.
Advantages
Disadvantages
Priority Scheduling
In this type of scheduling the CPU is allocated to the process with the
highest priority after completing the present running process.
Advantage
Disadvantage
In this type of scheduling the CPU is allocated to the process with the
highest priority immediately upon the arrival of the highest priority
process. If the equal priority process is in running state, after the
completion of the present running process. CPU is allocated to this even
though one more equal priority process is to arrive.
Advantage
Very good response for the highest priority process over non-
preemptive version of it.
Disadvantage
Starvation may be possible for the lowest priority processes.
Round-Robin Scheduling
The process may have a CPU burst of less than the time quantum
or
CPU burst of currently executing process be longer than the time
quantum. In this case a context switch occurs the process is put at
the tail of the ready queue.
Advantages
Disadvantages
Performance of RR Scheduling
Disadvantage
Longer processes may still suffer with starvation. For overcoming this
problem promote a process to a higher-priority queue after it spends a
certain amount of time in waiting for execution.
The ready queue is partitioned into number of ready queues. Each ready
queue should have certain priority and can have its own scheduling
algorithm. This is created for situations in which processes are easily
classified into groups:
Foreground(Interactive) processes
Background(Batch) processes
Eg. 80% to foreground queue for RR and 20% to background queue for
FCFS.