0% found this document useful (0 votes)
45 views3 pages

Three Process Pro Bans

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

Three Process Pro Bans

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

1. Three process P1,P2,P3 with process time 20,30,10 respectively.

Each process uses the first 30%


of its process time in CPU, then 50% in I/O and last 20% in CPU again. Find out average waiting
time, average turn-around time and response time and CPU utilization, if the system follows
FCFS scheduling.

Process Process time Arrival Time

P1 20 0

P2 30 0

P3 10 0

Process Time ArrivalTime(AT 30%CPUburst(BT 50%IOburst 20%CPUburst


) )

P1 20 0 6 10 4

P2 30 0 9 15 6

P3 10 0 3 5 2

P1 P2 P3 P1 P3 P2

0 6 15 16 18 22 23 25 30 36

Throughput(CT) TurnAroundTime(TAT) WaitTime(WT) ResponseTime(RT)


=TAT-BT

P1 22 22 12 22-10 0

P2 36 36 21 36-15 6

P3 25 25 20 25-5 15

P1 comes back to ready queue at 6 + 10= 16 units of time

P2 comes back to ready queue at 15 + 15=30 units of time

P1 comes back to ready queue at 18 + 5 = 23 units of time

At time unit 18 which process is available at head of ready queue after finishing IO?

At time unit 22 any process is available at head of ready queue after finishing IO ?

At time unit 25 any process is available at head of ready queue after finishing IO ?

CPU Utilization = Expected CPU time / ActualTime the Processor is busy= (10+15+5)/36= 0.833=8.33%
CPU Idle time = (1 + 5)/ 36 = 6/36 = 0.1666 = 16.66%

2. Solve the previous problem using SJF scheduling, where time quantum 3units and context
switching time 1 unit.Underlined part not used

Process Time ArrivalTime(AT 30%CPUburst(BT 50%IOburst 20%CPUburst


) )

P1 20 0 6 10 4

P2 30 0 9 15 6

P3 10 0 3 5 2

P3 P1 P3 P2 P1 P2

0 3 9 11 20 24 35 41

Throughput(CT) TurnAroundTime(TAT) WaitTime(WT) ResponseTime(RT)


=TAT-BT

P1 24 24 14 24-10 3

P2 41 41 26 41-15 11

P3 11 11 6 11-5 0

P3 comes back to ready queue at 3 + 5= 8 units of time

P1 comes back to ready queue at 9 + 10=19 units of time

P2 comes back to ready queue at 20 + 15 = 35 units of time

At time unit 9 which process is available at head of ready queue after finishing IO?

At time unit 11 any process is available at head of ready queue ?

At time unit 20 any process is available at head of ready queue after finishing IO ?

CPU Utilization = Expected CPU time / ActualTime the Processor is busy= (10+15+5)/41= 0.731, 7.31%
CPU Idle time = (1 1)/ 41 = 0.268, 2.68%

3. Solve the problem using RR scheduling, where time quantum=3 units and context switching
time=1 unit.

Process Arrival Burst Time


Time
P1 0 8
P2 0 2
P3 0 7
P4 0 3
P5 0 5
Burst Arrival Throughput (TAT) (WT) (RT)
Time(BT)
Time(AT) (CT)

P1 8 0 32 32 24 0

P2 2 0 6 6 4 4

P3 7 0 34 34 27 7

P4 3 0 14 14 11 11

P5 5 0 29 29 24 15

P1 P2 P3 P4 P5 P1 P3 P5 P1 P3

0 3 4 6 7 10 11 14 15 18 19 22 23 26 27 29 30 32 33 34

Number of Context Switches = 9

CPU Utilization =Expected CPU /Actual time processor is engaged = 25/34= 0.735, 7.35%

You might also like