سوال ۹۷ کنکور ارشد مهندسی کامپیوتر ۱۴۰۳
در سیستمی ۲۰ فرایند موجود هستند. اگر الگوریتم زمانبندی فرایندها، Round Robin با مقدار کوانتوم ۱۰ میلیثانیه و زمان تعویض متن ۲ میلیثانیه باشد، آنگاه حداکثر چند میلیثانیه زمان لازم است که یک فرایند منتظر بماند تا نوبت به اجرای کوانتوم زمانی بعدیاش برسد؟
پاسخ صحیح: گزینهٔ C — ۲۲۸
In Round Robin each process gets the CPU for one quantum , then a context switch of ms hands the CPU to the next process. Here , ms, ms.
When a given process finishes its quantum, it must wait while all the other processes each take their turn before it runs again. Each turn of another process occupies one quantum plus the context switch that follows it:
The maximum wait until this process's next quantum begins is therefore
The slots account for the other quanta ( ms) plus the context switches that occur between them and the final switch back to this process ( ms), giving ms.
So the answer is 228 ms (option 3).
Pitfall: Use , not — the waiting process does not wait for itself. And do not forget to add the context-switch overhead to each of the other turns; ignoring it gives (the trap option 2).