Site hosted by Build your free website today!
OK.... Here's the algorithm. For every process we calculate what is called as starve time as follows..

Starve time = (time since last schedule)*CPU_FACTOR + (I/O time)*IO_FACTOR - Code execution time.

time since last schedule is amount of time elapsed since this guy was scheduled.

I/O time is amount of time a process has performed I/O. Its approximated as amount of time a process is not in runqueue. Its a cumulative count.

Code execution time is the cumulative amount of CPU used by the process until now.

We now calculate the starve time for all the process. Which ever process has the largest value of starve time , will be given the chance to schedule. Typically this process will be a one, that has performed more amount of I/O than others.(This is easily seen from the starve time calculation).