Re: How to change the time-slice value ?

From: George Anzinger (george@pioneer.net)
Date: Mon Aug 21 2000 - 21:25:31 EST


tdanis@canal-plus.fr wrote:
>
> Hello,
>
> How is it possible to change (run-time) the time-slice value applied to the
> Linux threads ? Could it be some parameter to the pthread_attr_setschedparam
> function ? If not, which is its default value ?
>
> Thanks in advance,
>
> A+,
> --
> Thierry Danis

The "time slice" is derived from the priority as follows:
priority 20 gives time slice 1
priority 19 gives time slice 2
  :
priority -20 gives time slice 41

priority can be set with setpriority(2), for which see the man page.
Since threads have pids, this works.

Slice values are in centaseconds.

For SCHED_RR tasks/threads the slice value is the RR time slice.
For SCHED_OTHER the slice value is used to drive the scheduler. Simply
stated the slices of all active threads are added together to form one
"time interval". Each task will get one of its "slice" times in each
"time interval". This statement assumes the impossible, i.e. that the
pool of active threads does not change and that, at least over "time
interval", the thread is unblocked enough to use its slice, when the
scheduler will allow it to.

SCHED_FIFO tasks do not use the slice at all.

George
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Aug 23 2000 - 21:00:06 EST