Dark Mode

0 votes

A possible interpretation of the problem is that we initially had jobs with actual run times 8, 7, 4, and 16. Assuming no new jobs entered the queue, we'd schedule then in increasing order of their times, namely 4, 7, 8, 16 (since that's what SJF means--shortest job first). Under these assumptions we'd have time slices

T2 = 1/2(4+10) =7 --> After first Job has run

T3 = 1/2(7+7) =7 --> After second Job has run

T4 = 1/2(8+7)=7.5 --> After first Job has run

so the fourth job would be given a slice of 7.5, which is choice (3).

This isn't an entirely satisfactory answer since of course the OS might not know how much time the jobs would actually take before hand, but if the problem assumed they'd be run in that order (4, 7, 8, 16) we'd have what was mentioned as the correct answer, so it's at least a*possible* interpretation.

0 votes

A possible interpretation of the problem is that we initially had jobs with actual run times 8, 7, 4, and 16. Assuming no new jobs entered the queue, we'd schedule then in increasing order of their times, namely 4, 7, 8, 16 (since that's what SJF means--shortest job first). Under these assumptions we'd have time slices

T2T3T4=12(4+10)=7=12(7+7)=7=12(8+7)=7.5after the first job has runafter the second job has runafter the third job has runT2=12(4+10)=7after the first job has runT3=12(7+7)=7after the second job has runT4=12(8+7)=7.5after the third job has run

so the fourth job would be given a slice of 7.5, which is choice (3).

This isn't an entirely satisfactory answer since of course the OS might not know how much time the jobs would actually take before hand, but if the problem assumed they'd be run in that order (4, 7, 8, 16) we'd have what was mentioned as the correct answer, so it's at least a*possible* interpretation.