1,374 views
2 votes
2 votes
Consider 3 process P0, P1, P2 to be scheduled as per SRTF algorithm. The process P0 is known to be scheduled first and when P0 is running 5 units of time the process P2 arrived. The process P2 has own 2 units of time, the process P1 ha arrived and completed running in 4 units of time. Then the minimum burst time of P0 is

2 Answers

6 votes
6 votes
Suppose Po burst time is x unit, P0 run for 5 units of time before getting preempted by P2, therefore remaining time = x-5 unit
P2 burst time is y unit, P2 runs for 2 units of time before getting preempted by P1, therefore remaining time = y-2
P1 run for 4 unit fo time.
Since P1 preempt P2, and SRTF is used so minimum value of P2 must be 5 unit at that time, so y-2 = 5 i.e y = 7
Similarly x-5 = 8, and x = 13 unit.
So minimum burst time of P0 is 13 unit
1 votes
1 votes
Ans=13 Since P1 has preempted the process P2 at the time of arrival. So the remaining burst time of P2 should be equal to 4+1=5. Now P2 has already executed for 2 units before getting preempted. So at the time of arrival , the total burst cycle of P2 would be 5+2=7. And again P2 has preempted P0 at the time of arrival, so P1 must have atleast 8 burst cylce at that time. So the min burst time of P0 is 8+5(because it has consumed its 5 bursts)=13

Related questions

0 votes
0 votes
3 answers
1
Chaitanya Kale asked Sep 22, 2022
629 views
If we are using non-preemptive CPU scheduling then can there be process state transition from running to ready state?
1 votes
1 votes
1 answer
2
iarnav asked Jan 12, 2022
385 views
Does non preemptive CPU scheduling needs hardware support.kindly explain.
1 votes
1 votes
1 answer
4
Ram Ahuja asked Feb 13, 2019
2,745 views
In which of the following case CPU utilization will be higher?(a) If all the processes are I/O bound(b) Is all the processes are equally CPU bound and I/O bound(c) If all...