Re: [Announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS]

Davide Libenzi
2007-04-14T23:26:07Z

On Sat, 14 Apr 2007, Davide Libenzi wrote:

> Haven't looked at the scheduler code yet, but for a similar problem I use
> a time ring. The ring has Ns (2 power is better) slots (where tasks are
> queued - in my case they were som sort of timers), and it has a current
> base index (Ib), a current base time (Tb) and a time granularity (Tg). It
> also has a bitmap with bits telling you which slots contains queued tasks.
> An item (task) that has to be scheduled at time T, will be queued in the slot:
>
> S = Ib + min((T - Tb) / Tg, Ns - 1);

... mod Ns, of course ;)

- Davide