CPU Scheduling Algorithms: Shortest Job First (SJF)
CPU Scheduling Algorithms: Shortest Job First (SJF)
4 4
Advantages of SJF
● It provides maximum throughput time.
● It is optimal as compared to FCFS.
● It provides minimum average waiting and turnaround time as compared to
FCFS.
● It is appropriate for jobs running in batch, where run times are known in
advance.
Disadvantages of SJF
● Complex to implement as we need to know the next process with shortest
execution time.
● This algorithm may cause very long turnaround times or starvation for long
processes.
● Requires knowledge of how long a process or job will run.
Study Resources & References for SJF
● https://www.guru99.com/shortest-job-first-sjf-scheduling.html#1
● https://www.gatevidyalay.com/sjf-scheduling-srtf-cpu-scheduling/
● https://www.youtube.com/watch?v=VCIVXPoiLpU
● https://www.youtube.com/watch?v=t0g9b3SJECg
Thank You