Explain Shortest Job First (SJF).

Q1. Explain Shortest Job First (SJF).

Ans. Clearly, the average waiting time under a purely first-in first-out system is going to often be poor if one task is significantly longer than the others.

So, the first idea that comes about after seeing this is the idea of having the shortest task go first, or shortest job first scheduling. This, obviously, would be similar to the idea above, except that as each job comes in, it is sorted into the queue based on size.

In shortest job first (SJF), waiting job (or process) with the smallest estimated run time to completion is run next. In other words, when CPU is available, it is assigned to the process that has smallest next CPU burst.

The SJF scheduling is especially appropriate for batch jobs for which the run times are known in advance.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: