6910 OS Revesion Important Topics
6910 OS Revesion Important Topics
• Waiting times P1 = 6; P2 = 0; P3 = 3
• The average waiting time: (6 + 0 + 3)/3 = 3
milliseconds.
Main Disadvantage of FCFS Algorithm
• There is a convoy effect as all the other
processes wait for the one big process to get
off the CPU.
• If one is CPU bound process and rest are IO
bound then we see convoy effect.
• This effect results in lower CPU and device
utilization than might be possible if the
shorter processes were allowed to go first.
Shortest-Job-First (SJF) scheduling
• When the CPU is available, it is assigned to the
process that has the smallest next CPU burst.
• More appropriate term for this scheduling method
would be the shortest-next-CPU-burst algorithm
• The SJF algorithm is non-preemptive
• But the SJF algorithm also has preemptive
version.
• Preemptive SJF scheduling is sometimes called
shortest-remaining- time-first scheduling.
Non-preemptive (SJF) scheduling
• As an example of SJF scheduling, consider the following set
of processes, with the length of the CPU burst given in
milliseconds:
τn+1= α tn + (1- α) τn
• where, 0 ≤ α ≤ 1.
Preemptive (SJF) scheduling
• Preemptive SJF scheduling is sometimes called shortest-
remaining-time-first scheduling