HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)
r
rtsched(2) rtsched(2)
param, respectively. The value of the sched_priority member in the param structure can be any integer
within the inclusive priority range for the scheduling policy specified by policy.
The possible values for the policy parameter are defined in the header file
<sched.h>, and mentioned
below.
If a process described by pid exists, the scheduling policy and scheduling parameters are set for the process
whose process ID is equal to pid.
If pid is zero, the scheduling policy and scheduling parameters are set for the calling process.
If the process pid contains more than one thread or lightweight process (that is, the process is mul-
tithreaded), this function will affect the policy and priority of individual kernel schedulable entities in the
process depending on their scheduling contention scope.
• For threads created with system contention scope, this system call will have no effect on their schedul-
ing or the scheduling of the underlying kernel scheduled entities.
• For threads with process contention scope, the threads’ scheduling parameters will not be affected.
However, the underlying kernel scheduled entities for the process contention scope threads will have
their scheduling parameters changed to the value specified in param. Kernel scheduled entities for
use by process contention scope threads that are created after this call completes, inherit their
scheduling policy and associated scheduling parameters from the process.
The priority returned is the old priority of the target process, though an individual thread or lightweight
process may have a different value if some other interface is used to change individual thread’s or light-
weight process’s priority.
The
OWNER privilege is required to change the scheduling parameters of another process.
The calling process must have the RTSCHED privilege to successfully call sched_setscheduler()
.
The
sched_setscheduler()
function is considered successful if it succeeds in setting the scheduling
policy and scheduling parameters of the process specified by pid to the values specified by policy and the
structure param, respectively.
sched_getscheduler()
The
sched_getscheduler()
function returns the scheduling policy of the process specified by pid.
The values that can be returned by
sched_getscheduler()
are defined in the header file
<sched.h> (see sched_setscheduler()
).
If a process described by pid exists, the scheduling policy is returned for the process whose process ID is
equal to pid.
If pid is zero, the scheduling policy is returned for the calling process.
If the process pid contains more than one thread or lightweight process (that is, the process is mul-
tithreaded), this function shall only return the process scheduling policy and priority. Individual threads or
lightweight processes in the target process will have their own scheduling policies and priorities which may
be different from the scheduling policy and priority of their process.
sched_yield()
The
sched_yield() function forces the calling thread to relinquish the processor until it again becomes
the head of its thread list. It takes no arguments.
sched_get_priority_max(), sched_get_priority_min()
The sched_get_priority_max() and sched_get_priority_min()
functions return the
appropriate maximum or minimum, respectively, for the scheduling policy specified by policy.
The value of policy must be one of the scheduling policy values defined in
<sched.h>.
sched_rr_get_interval()
The sched_rr_get_interval() function updates the timespec structure referenced by the interval
argument to contain the current execution time limit (that is, time quantum) for the process indicated by
pid under the
SCHED_RR policy, at which a scheduling decision will be made when another process at the
same priority is ready to execute. If pid is zero, the current execution time limit for the calling process is
returned.
348 Hewlett-Packard Company − 3 − HP-UX 11i Version 3: February 2007