rtsched.1 (2010 09)

r
rtsched(1) rtsched(1)
changed for some LWPs.
If the user is not a member of a group having
PRIV_RTSCHED access and is not the user with appropri-
ate privileges, command is not scheduled, or pid ’s/ lwpid’s real-time priority is not changed. When
changing the real-time priority of a currently executing process/LWP, the effective user ID of the calling
process must be the user with appropriate privileges, or the real or effective user ID must match the real
or saved user ID of the process to be modified.
In presence of processor sets (see pset_create (2) for details), the application execution is restricted to pro-
cessors in the application’s processor set. The threads in different processor sets do not compete with one
another for processors based on their scheduling policy and priority values. The scheduler looks only at
threads assigned to a processor’s processor set to choose the next thread to run.
RETURN VALUE
rtsched returns exit status:
0 if command is successfully scheduled or if pid ’s or lwpid ’s real-time priority is successfully
changed;
1 if command is not executable, pid or lwpid does not exist, or priority is not within the priority
range for the corresponding scheduler;
2 if command (pid/lwpid ) lacks real-time capability, or the invoker’s effective user ID is not a
user who has appropriate privileges, or the real or effective user or the real or effective user ID
does not match the real or saved user ID of the process being changed; or
5 if rtsched encountered an internal error or if rtsched is not supported by this release.
EXAMPLES
Execute file
a.out with SCHED_FIFO at a priority of 10:
rtsched -s SCHED_FIFO -p 10 a.out
Execute file a.out with SCHED_RTPRIO at a priority of 127 (this is synonymous to rtprio 127
a.out):
rtsched -s SCHED_RTPRIO -p 127 a.out
Execute file a.out with the SCHED_HPUX scheduler:
rtsched -s SCHED_HPUX a.out
This is useful to spawn a timeshare priority command from a real-time priority shell.
Set the currently running process, pid 24217, to execute with SCHED_RR2 at a priority of 20:
rtsched -s SCHED_RR2 -p 20 -P 24217
Now change its priority to 10 using the same scheduler:
rtsched -p 10 -P 24217
Set the currently running LWP, lwpid 987312, to execute with SCHED_RR at a priority of 10:
rtsched -s SCHED_RR -p 10 -G 987312
Set all currently executing LWPs in a process pid 21342 to execute with SCHED_FIFO at a priority of 25:
rtsched -s SCHED_FIFO -p 25 -P 21342 -G ALL
WARNINGS
The priority values used by rtsched may differ from those used by other commands. For example,
ps(1) displays the internal representation of priority values.
AUTHOR
rtsched was developed by HP.
SEE ALSO
rtprio(1), setprivgrp(1M), getprivgrp(2), pset_create(2), rtprio(2), rtsched(2), _lwp_getscheduler(2),
_lwp_setscheduler(2), pstat_getlwp(2).
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010