schedulers
computers
EEVDF
We can start with a lag at 0 for everyone. As the time quantum passes, the lag for a process that did not run increases. So then lag accumulates.
Client server mechanism, wher each quantum is what it changes:
```
An example might help to visualize how lag works. Imagine three CPU-bound tasks, called A, B, and C, that all start at the same time. Before any of them runs, they will all have a lag of zero:
A B C
Lag: 0ms 0ms 0ms
Since none of the tasks have a negative lag, all are eligible. If the scheduler picks A to run first with a 30ms (to pick a number) time slice, and if A runs until the time slice is exhausted, the lag situation will look like this:
A B C
Lag: -20ms 10ms 10ms
Over those 30ms, each task was entitled to 10ms (one-third of the total) of CPU time. A actually got 30ms, so it accumulated a lag of -20ms; the other two tasks, which got no CPU time at all, ended up with 10ms of lag, reflecting the 10ms of CPU time that they should have received.
Task A is no longer eligible, so the scheduler will have to pick one of the others next. If B is given (and uses) a 30ms time slice, the situation becomes:
A B C
Lag: -10ms -10ms 20ms
Once again, each task has earned 10ms of lag corresponding to the CPU time it was entitled to, and B burned 30ms by actually running. Now only C is eligible, so the scheduler's next decision is easy.
One property of the EEVDF scheduler that can be seen in the above tables is that the sum of all the lag values in the system is always zero.
```
Work Stealing