In this topic, you will learn about, **Shortest Job First (SJF) scheduling.**

A different approach to CPU scheduling is the SJF algorithm. These algorithm associates with each process the length of the latter’s next CPU burst. When the CPU is in, it is assigned to that process that has the smallest next CPU burst. Therefore, this algorithm is also known as Shortest Next CPU Burst algorithm.

The SJF algorithm is provably optimal, in that it gives the minimum average waiting for a given set of processes. By moving a short process before a long one the waiting time of the short process decreases more than it increases the waiting time of the long process consequently, the average waiting time decreases.

The real difficulty with the short job first algorithm is knowing the length of the CPU request. SJF scheduling is used frequently in long term schedule. Although the SJF algorithm is optimal, it cannot be implemented at a level of short-term scheduling.

The SJF algorithm may be either primitive or non-primitive. Primitive SJF scheduling is sometimes called Shortest-Remaining-Time-First (SRTF) Scheduling.

Comment below if you have queries related to the above topic, **Shortest Job First (SJF) scheduling.**

## Leave a Reply