root
Moderator
 Moderator
| Posts: 121 |   | Karma: 1
|
Re: round robin scheduling - 2004/10/16 09:19
One of the oldest, simplest, fairest, and most widely used scheduling algorithms is round robin. Each process is assigned a time interval, called its quantum, which it is allowed to run. If the process is still running at the end of the quantum, the CPU is preempted and given to another process. If the process has blocked of finished before the quantum has elapsed, the CPU switching is done when process blocks, of course.
As about its implementation, akk the scheduler needs to do is maintain a list of runnable processes. When the quantum runs out on a process, it is put on the end of the list.
The only interesting issue with round robin is the length of the quantum. Switching from one process to another requires a certain amount of time for doing the saving and loading registers and memory maps, updating mic tables etc.
I don't have the time now, but round robin is easy to implement. You could paste here your exisiting code, and we'll work it out.
Good luck!
|