Hi

"Each process runs for a timeslice proportional to its weight divided by the
> total weight of all runnable threads". The algorithm sets a targeted latency
> and it shares that process time among the processes according to their
> priorities. That is clear , but what is not clear is the example at the same
> paragraph :
>
> He says if we have 2 processes and have 20ms to share between them each
> will run 10 ms "Regardless of their priority". Doesnt that explanation
> conflicts with one above ?
>

 I had to read this a couple of times too when I read this chapter, but I
think it's right. Looking at the complete sentence and the one before it:

'Let's assume that the targeted latency is 20 milliseconds and we have two
runnable tasks at the same priority. _Regardless of those tasks' priority_,
each will run for 10 milliseconds before preempting in favour of the other.'

To re-phrase this, what I think Robert means is that in this example
_regardless of (how high or low) those (two) tasks' priority (is)_, they
will still run for 10 milliseconds each (because they are the only two tasks
and their priority is the same).

>
> Also another example the author gives is not very clear again:
>
> At the end of the page 49 he gives 2 examples :
>
> The latency is 20ms , there are 2 processes 0 and 5 (nice valued) and each
> have 15 and 5 ms.
> The second example is 2 processes at nice values 10 and 15 and they got
> again 15 and 5 ms.
>

If we look over the page, Robert says:

'The nice values, instead of yielding additive increases to timeslices,
yield geometric differences.'

In other words, instead of having a statically predetermined series of
absolute value steps to set a process' timeslice to according to its
priority (as in the case of 0/1 or 'traditional' *nix timeslice behaviour),
the value is calculated along a more dynamic 'sliding scale', being related
also to the target latency and the number of processes present.

In your two examples above, each has only two processes to be compared to
each other. So their timeslice is set according to the _difference between_
their nice values, rather than what the absolute values of those individual
nice values are.

Hopefully that's made it clearer.

Thanks
Julie

Reply via email to