Topic: Operating Systems
Process P1, P2 and P3 with execution time of 6 ms, 4 ms and 2 ms respectively enter in ready state together in order P1, P2, P3. Calculate the waiting and turnaround time of Process P1. Assuming no wait time due to I/O and round robin scheduling with time slot of 2 ms.
- A. 6 ms, 12 ms
- B. 6 ms, 10 ms
- C. 4 ms, 4 ms
- D. 4 ms, 6 ms
Answer: A. 6 ms, 12 ms
Explanation: Using Round Robin with a 2 ms time quantum: P1 runs (0-2ms), remaining=4ms. P2 runs (2-4ms), remaining=2ms. P3 runs (4-6ms), finishes. P1 runs (6-8ms), remaining=2ms. P2 runs (8-10ms), finishes. P1 runs (10-12ms), finishes at 12ms. Turnaround time for P1 = Finish time - Arrival time = 12 - 0 = 12 ms. Waiting time for P1 = Turnaround time - Burst time = 12 - 6 = 6 ms.