Computer Science, asked by aditya0612, 18 days ago

Consider 4 processes P1,P2,P3 and P4 with Arrival times 0, 1, 2
and 4 respectively. The Burst times of P1,P2,P3 and P4 are 5, 4,
2 and 1 respectively. Calculate the average turnaround time and
average waiting time using the Round robin algorithm if the time
quantum is 2 units.

Answers

Answered by icyihu
0

Explanation:

processes P1,P2,P3 and P4 with Arrival times 0, 1, 2

and 4 respectively. The Burst times of P1,P2,P3 and P4 are 5, 4,

2 and 1 respectively. Calculate the average turnaround time and

average waiting time

Answered by priyarksynergy
0

Given are the arrival times and the burst times of four processes, Find their average turnaround and average waiting times using round robin

Explanation:

  • In the round-robin scheduling algorithm each process is given a fixed amount of time (time quantum) to run and then the next process is given the same time to run and so on in a cyclic way.
  • Meanwhile a queue known as the ready queue is maintained to follow which process is to be scheduled next based on the arriving order.  
  • We get the order of processes scheduled and time for which they each run as,  P1_{0-2}\ \ \ P2_{2-4}\ \ \ P3_{4-6}\ \ \ P1_{6-8}\ \ \ P4_{8-9}\ \ \ P2_{9-11}\ \ \ P1_{11-12}  
  • Given below is the table for turnaround and waiting times for each process, Process\ no. \ \ \ \ AT\ \ \ \ BT\ \ \ \ \ CT \ \ \ \  \ TAT(=CT-AT)\ \ \ \ \ WT(=TAT-BT) \\P1\ \ \ \  \ \ \ \  \ \ \ \ \ \ \ \ \ 0\ \ \ \ \ \ \ 5\ \ \ \ \  \ \ \ 12\ \ \  \ \  \ \ \ \ \ 12\ \ \  \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \  \ \ \ \ \ \ \ 7  \\P2\ \ \ \  \ \ \ \  \ \ \ \ \ \ \ \ \ 1\ \ \ \ \ \ \ 4\ \ \ \ \  \ \ \ 11\ \ \  \ \  \ \ \ \ \ 10\ \ \  \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \  \ \ \ \ \ \ \ 6\\  P3\ \ \ \  \ \ \ \  \ \ \ \ \ \ \  2\ \ \ \ \ \ \ 2\ \ \ \ \  \ \ \ 6\ \ \  \ \  \ \ \ \ \ 4\ \ \  \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \  \ \ \ \ \ \ \ 2\\P4\ \ \ \  \ \ \ \  \ \ \ \ \ \ \ 4\ \ \ \ \ \ \ 1\ \ \ \ \  \ \ \ 9\ \ \  \ \  \ \ \ \ \ 5\ \ \  \ \ \ \ \ \ \ \ \ \ \ \  \ \ \ \ \  \ \ \ \ \ \ \ 4              
  • Hence we get the average waiting and turnaround times as,  Av._{TAT}=\frac{12+10+4+5}{4} \ \ \  \ \ \ ->Av._{TAT} =7.75 \ units\\Av._{WT}=\frac{7+6+2+4}{4} \ \ \  \ \ \ ->Av._{TAT} =4.75 \ units  
Similar questions