in Operating System edited by
982 views
5 votes
5 votes

Consider four processes with a burst time of $10, 20, 30, 40$ all process arrived at time $0$. Each process spends first $10$% of its execution time doing $i/0$, next $40$% time doing CPU operations, next $20$% time doing $I/0$ and the last $30$% time doing CPU operations. The system uses shortest remaining time next algorithm for scheduling. Calculate the completion time of $P3$?

in Operating System edited by
982 views

2 Comments

Is it 43??
0
0
No, I will tell the answer soon :), but please share your respective gantt charts.
0
0

1 Answer

11 votes
11 votes
Best answer

p3 completes at 49

 

  Arrival Burst 10% IO 40%CPU 20%IO 30%CPU
P1 0 10 1 4 2 3
P2 0 20 2 8 4 6
P3 0 30 3 12 6 9
P4 0 40 4 16 8 12



Gant chart

0--- no process--- -1--P1---5---P2---7---P1---10---P2----16----P3----20----P2----26-----P3----34----P4----40----P3----49----P4---59-----no process----67----P4---79

selected by

4 Comments

got it!! Thanks. Missed the part where it is mentioned shortest remaining time next algo.
0
0
hey how u made the gant chart,  u are overlapping the i/o with other job computation . spooling technique, why u just not overlap the job own computation with i/o . pre fetching technique.
0
0

Hi Pooja Palod,

I am sorry , but could not understand the gnatt chart. 

At time t=0 all processes arrive . Then P1 does its first IO till 1 , so nothing need to be done. next P1 does first CPU till 5. Then P1 goes for second IO till 8 , so no P1 now. 

Now , P1 has only 3 remaining. So , why you are scheduling P2 ? 

Can you please explain a little bit ?

0
0
Process p1 does io from 5 to 7  so at that time we can schedule p2 now p1 needs 3 unit cpu burst so we preempt p2 and schedule p1
1
1