diff options
Diffstat (limited to 'man2/sched_setscheduler.2')
| -rw-r--r-- | man2/sched_setscheduler.2 | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/man2/sched_setscheduler.2 b/man2/sched_setscheduler.2 index dc62559dcc..317544ca0c 100644 --- a/man2/sched_setscheduler.2 +++ b/man2/sched_setscheduler.2 @@ -110,8 +110,11 @@ Processes scheduled with \fISCHED_OTHER\fP or \fISCHED_BATCH\fP must be assigned the static priority 0. Processes scheduled under \fISCHED_FIFO\fP or \fISCHED_RR\fP can have a static priority in the range 1 to 99. -The system calls \fBsched_get_priority_min\fP(2) and -\fBsched_get_priority_max\fP(2) can be used to find out the valid +The system calls +.BR sched_get_priority_min (2) +and +.BR sched_get_priority_max (2) +can be used to find out the valid priority range for a scheduling policy in a portable way on all POSIX.1-2001 conforming systems. @@ -137,7 +140,10 @@ blocked again. When a \fISCHED_FIFO\fP process becomes runnable, it will be inserted at the end of the list for its priority. A call to -\fBsched_setscheduler\fP() or \fBsched_setparam\fP(2) will put the +.BR sched_setscheduler () +or +.BR sched_setparam (2) +will put the \fISCHED_FIFO\fP (or \fISCHED_RR\fP) process identified by \fIpid\fP at the start of the list if it was runnable. As a consequence, it may preempt the currently running process if @@ -146,14 +152,17 @@ it has the same priority. of the list.) .\" In 2.2.x and 2.4.x, the process is placed at the front of the queue .\" In 2.0.x, the Right Thing happened: the process went to the back -- MTK -A process calling \fBsched_yield\fP(2) will be +A process calling +.BR sched_yield (2) +will be put at the end of the list. No other events will move a process scheduled under the \fISCHED_FIFO\fP policy in the wait list of runnable processes with equal static priority. A \fISCHED_FIFO\fP process runs until either it is blocked by an I/O request, it is -preempted by a higher priority process, or it calls \fBsched_yield\fP(2). +preempted by a higher priority process, or it calls +.BR sched_yield (2). .SS SCHED_RR: Round Robin scheduling \fISCHED_RR\fP is a simple enhancement of \fISCHED_FIFO\fP. Everything @@ -168,7 +177,8 @@ been preempted by a higher priority process and subsequently resumes execution as a running process will complete the unexpired portion of its round robin time quantum. The length of the time quantum can be -retrieved using \fBsched_rr_get_interval\fP(2). +retrieved using +.BR sched_rr_get_interval (2). .\" On Linux 2.4, the length of the RR interval is influenced .\" by the process nice value -- MTK .\" @@ -181,7 +191,11 @@ The process to run is chosen from the static priority 0 list based on a dynamic priority that is determined only inside this list. The dynamic priority is based on the nice level (set -by \fBnice\fP(2) or \fBsetpriority\fP(2)) and increased for +by +.BR nice (2) +or +.BR setpriority (2)) +and increased for each time quantum the process is ready to run, but denied to run by the scheduler. This ensures fair progress among all \fISCHED_OTHER\fP |
