867 views
2 votes
2 votes
2)4 processes arriving at time 0,0,2,5 with total execution time 10,20,30,40 units respectively. Each process spends the first 20% of execution time doing I/O, 70% time doing computation and last 10% time doing I/O again.The percentage of CPU idle time for the schedule length using shortest remaining time first is _________________

2 Answers

Best answer
1 votes
1 votes

In Process1 first 2 unit for IO, next 7 unit for computation, next 1 unit for IO

In Process2 first 4 unit for IO, next 14 unit for computation, next 2 unit for IO

In Process3 first 6 unit for IO, next 21 unit for computation, next 3 unit for IO

In Process4 first 8 unit for IO, next 28 unit for computation, next 4 unit for IO

IO time will overlap with if some other process want to compute then

Gantt chart

0______2(I/O time)|_____________P1_______________9(Process1)

__________P2______________23(Process2)________P3_________44(Process3)___________________

P4_____________72(Process4)_________4(I/O)_________76

So, among 76 unit time

6unit used for IO

72 unit require for process to complete

So, in IO time in percent $\frac{6}{76}\times 100=7.8$

selected by
1 votes
1 votes
Process AT I/O CPU I/O
P1 0 2 7 1
P2 0 4 14 2
P3 2 6 21 3
P4 5 8 28 4

 USING SRTF:

IDLE P1 P2 P3 P4 IDLE
0-2 2-9 9-23 23-44 44-72 72-76

%of time cpu idle = idle time / total cpu time

                         = 6/76*100 =7.89%

Related questions

1 votes
1 votes
1 answer
2
Nandkishor3939 asked Jan 17, 2019
2,778 views
I have solved this but not getting the answer…. will any one verify its correctness plzThank you:)
0 votes
0 votes
1 answer
3
iarnav asked Jul 17, 2018
834 views
Let's say we have four processes as (P1, P2, P3, P4) and have Arrival time as (0,1,2,3) respectively, but all of them has same CPU Burst time as (10ms) then does SRTF wil...