Consider N processes sharing the CPU in a round-robin fashion (N>2). Assume that
ID: 3550058 • Letter: C
Question
Consider N processes sharing the CPU in a round-robin fashion (N>2). Assume that each context switch takes S msec and taht each time quantum is Q msec. For simplicity, assume that processes never block on any event and simply switch between the CPU and the ready queue.
1. What is the maxmum consecutive period of time any process remains in the ready queue (the max waiting time) expressed in terms of N,S,Q?
2. Now let N=3, Q= 10, with process Pi requiring Ti ms of CPU process time, where i = 0,1,2. Give that T1=6, T2=9, T3 = 12. What is the average waiting time? (all units are msec)
For this one, I got (0+0+15)/3=5 ms, is it correct?
Explanation / Answer
1. A process will wait for maximum time if each of the before processes consume all the time quantum Q and every time there is a context switch. So the maximum waiting time is (N - 1) x (S + Q).
2. Yes. You are right because the first two process don't need to wait as they take time less than time Quantum.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.