2
$\begingroup$

Look at the below table for example :
enter image description here

Look at the Non-Preemptive SJF table
Suppose if the burst time of process $P_1$ was a very large number compared to $7$, the processes $P_3,P_2$ and $P_4$ have to wait for a large amount of time till $P_1$ frees the CPU.
No book or article that I've read mentions of SJF being a subject to convoy effect?
Why not?

$\endgroup$
2
$\begingroup$

I think you're not using the same terminology as the books and articles you're reading. Non-preemptive schedulers suffer from priority inversion, not convoy effects.

Most scheduling disciplines (FIFO, SJF, LJF, Nearest-deadline-first, ...) can be reframed as highest priority first schedulers, where what changes from discipline to discipline is the priorities assigned to the jobs. So first-in-first-out (FIFO) scheduling assigns priorities according to their order of arrival. Shortest-job-first (SJF) assigns priorities according to the burst time. In preemptive shortest-job-first the scheduler is always running the job with the highest priority. In non-preemptive shortest-job-first scheduling if a short job arrives after a longer job already starts, then the scheduler will be running the lower priority job instead of the high priority job for a while.

A convoy effect is a different problem where jobs that need many different kinds of service get clumped up together because of decisions you have made elsewhere in the system. It applies to things like schedulers that deal with jobs that have more than one burst (separated by time when those jobs are waiting for i/o, or when jobs are waiting for a lock). For the lock case there's a wikipedia article: http://en.wikipedia.org/wiki/Lock_convoy.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.