IdeasCuriosas - Every Question Deserves an Answer Logo

In Computers and Technology / High School | 2025-07-03

Consider the following set of processes arriving at time 0, with CPU burst time given in milliseconds (ms). Calculate the following using round robin scheduling algorithm with time quantum 4 ms.

(i) Average waiting time
(ii) Average turnaround time

| Process | CPU Burst Time (ms) |
|---------|--------------------|
| P1 | 24 |
| P2 | 3 |
| P3 | 3 |

Asked by hazgrot1525

Answer (1)

To solve this problem using the Round Robin scheduling algorithm with a time quantum of 4 ms, we must distribute the CPU burst times among the processes in a fair and cyclic manner. We'll begin by distributing CPU time in rounds, with each process getting up to 4 ms of CPU time in each round until all processes are completed.
Processes and CPU Burst Time:

P1: 24 ms
P2: 3 ms
P3: 3 ms

Round Robin Execution:

1st Round:

P1 executes for 4 ms (remaining 20 ms).
P2 executes for 3 ms (completed).
P3 executes for 3 ms (completed).


2nd Round:

P1 executes for 4 ms (remaining 16 ms).


3rd Round:

P1 executes for 4 ms (remaining 12 ms).


4th Round:

P1 executes for 4 ms (remaining 8 ms).


5th Round:

P1 executes for 4 ms (remaining 4 ms).


6th Round:

P1 executes for 4 ms (completed).



Completion times for processes:

P1 completes at 24 ms.
P2 completes at 7 ms.
P3 completes at 10 ms.

Turnaround Time Calculation: Turnaround time is the total time taken from process arrival to completion.

Turnaround time for P1 = 24 ms.
Turnaround time for P2 = 7 ms.
Turnaround time for P3 = 10 ms.
Average Turnaround Time = 3 24 + 7 + 10 ​ = 3 41 ​ ≈ 13.67 ms.

Waiting Time Calculation: Waiting time is the total time the process has been in the ready queue.

Waiting time for P1 = 24 - 24 = 0 ms.
Waiting time for P2 = 7 - 3 = 4 ms.
Waiting time for P3 = 10 - 3 = 7 ms.
Average Waiting Time = 3 0 + 4 + 7 ​ = 3 11 ​ ≈ 3.67 ms.

In summary, the average waiting time is approximately 3.67 ms, and the average turnaround time is approximately 13.67 ms for the given set of processes using Round Robin scheduling with a time quantum of 4 ms.

Answered by JessicaJessy | 2025-07-06