Solution
The correct answer is 76 ms
Key Points
- In round-robin scheduling, every process gets an equal share of CPU time, which is defined by the time quantum or time slice. Assuming there's no context switching time, each process will get to use the CPU for the duration of the time quantum then get placed at the end of the ready queue.
- In this case, the time quantum is 4 ms and there are 20 processes in total.
- Since one cycle for all the processes to get CPU once equals to "number of processes" times "time quantum", this means one cycle will take 20*4 = 80 ms.
- Given that CPU is free now, the first process doesn't have to wait, so it gets the CPU immediately. But the last process, i.e., the 20th process has to wait for 19 processes (not full 20, because the first process didn't wait) to complete their quanta before getting CPU. That means
- Maximum wait time = (Number of processes - 1) * Time quantum
- Maximum waiting time for a process is 19*4 = 76 ms.
Therefore, option 2), 76ms is correct.