5,787 views
2 votes
2 votes
Three processes P1, P2 and P3 arrive at time zero. The total time spent by the process in the system is 10ms, 20ms, and 30ms respectively. They spent the first 20% of their execution time doing I/O and the rest 80% in CPU processing. What is the percentage utilization of CPU using FCFS scheduling algorithm?

1 Answer

Best answer
4 votes
4 votes

@LRU

Process    Execution time   I/O time    CPU time

P1            10                           2                  8

P2            20                           4                  16

P3            30                            6                   24

 

     |    P1    | P2       | P3         |

0   2          10          26           50

 

 

Since all the processes will first do I/O and then CPU processing, process P1 spends first 20% i.e. 2ms in doing I/O ..

So CPU is not utilized for the first 2ms…

 

Then P1 spends next 80% i.e. 8ms on processing.

By the time P1 finishes with CPU processing P2 has finished its I/O (4ms) and then it gets turn for CPU processing which it does for 16ms and similarly P3 does processing for next 24ms….

 

Total time

= 50ms …

CPU utilized for 48ms (starting from 2 and ending at 50) ….

Therefore utilization

= (48/50)*100

= 96% ..

 

 

selected by

Related questions

2 votes
2 votes
1 answer
4
LRU asked Nov 22, 2021
400 views
Consider the equivalence relation R induced by the partition P={{1},{3},{2,4,5,6}} of set A={1,2,3,4,5,6}.The number of ordered pairs in R is ____