Practice mode Operating Systems

Processes P1, P2 and P3 all arrive at time 0 with CPU burst times of 10, 4 and 2 ms. What is the average waiting time under non-preemptive SJF scheduling?

Correct answer D. 2.67 ms

Explanation

SJF runs the shortest job first: P3 (0-2), then P2 (2-6), then P1 (6-16). Waiting times are 0, 2 and 6 ms, so the average is 8 / 3, about 2.67 ms. The same jobs in FCFS order average 8 ms. Running short jobs first moves waiting onto the one long job, which is why SJF gives the minimum average waiting time for a given set of jobs.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

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

Links and website addresses are not allowed in comments.