(abbreviated as SJF) SJF is a process scheduling strategy which favors short, interactive jobs over long batch jobs. This optimizes
response time as the following example shows.
Imaging three jobs arriving at a process scheduler at the same time. Bobo, the big algebra system trying to solve a system of 100000
equations; Dada, the database system extracting all Fridays from a sales database; and Eddy, the editor ready to change an 'X' into a
'U'. We assume that Bobo will take 1000 seconds, Dada 100 seconds and
Eddy 0.1 second and that we have no preemption at all (i.e. not even
due to blocking). If the three jobs are executed B D E, Bobo will be
ready after 1000 seconds, Dada after 1100 and Eddy after 1100.1
(unless you reboot your computer before out of frustration). The
average of this is 1066.7 seconds. If SJF is applied, the execution
order is E D A, which leads to response times of 0.1, 100.1 and 1100.1
with an average of 400.1 seconds.
Of course with preemption and the incorporation of other criteria
the best execution order may differ. If also efficiency is to be observed, one should start with Dada to get the I/O system busy as early as possible but execute Eddy at the first time Dada blocks.