MIT JOS # Round-robin scheduling#
The following is the implementation of the Round-robin scheduling strategy in the MIT Jos.
Inside the KERN/SCHED.C.
The following from <<modern Operating system>> (formerly moved Brick also has the advantage of WOW ~)
The combination of code can be a very image of understanding round-robin.
Every time we call Sched_yeild (), we're going to let the current process get out of the CPU.
So the idle = thiscpu->cpu_env;
Each time we give up the current process and then let the queue run from the "most recent" process of the current process, using the CPU
The so-called queue I mentioned here is not a priority queue, round robin takes all the processes into consideration as equally important, without the weight of the points.
Only all env structures are continuous structures. Able to find them using an index.
There are a variety of other scheduling strategies, you can go to see <<modern Operating system>>
MIT JOS # Roundrobin scheduling#