Special case scheduling [closed]

感情迁移 提交于 2019-12-01 11:19:19

What I get from you description is:

Time 0:

Process 1 starts using its time slice, e.g. 5 units.

Time 5:

Process 2 arrives. Process 1 used up its time slice and is replenished.

A round robin scheduler checks the ready queue by selecting the next process with time left. At time 0 your ready queue looks like this:

P1

At time 5:

P1 going over to P1 -> P2

Tanenbaum writes in Modern Operating Systems: When a process used up it's time slice, it is enqueued at the end. So what happens is, that P1 is enqueued again before P2 is enqueued for the first time. This saves an additional context switch from P1 to P2 and back to P1. If you want P2 to be run first, then you can use priority base round robin.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!