Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ rtprio(2) — HP-UX 5.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

rtprio(1)

getprivgroup(2)

plock(2)

,nice(2)

RTPRIO(2)

NAME

rtprio − change or read realtime priority

SYNOPSIS

#include <sys/rtprio.h>
 int rtprio (pid, prio)
int pid, prio;

HP-UX COMPATIBILITY

Level: HP-UX/STANDARD - Real Time

Origin: HP

DESCRIPTION

Rtprio is used to set or read the realtime priority of a process.  If pid is zero, it names the calling process; otherwise it gives the pid of the process.  When setting the realtime priority of another process, the real or effective user ID of the calling process must match the real or effective user ID of the process to be modified, or the effective user ID of the calling process must be that of super-user.  The calling process must also be a member of or have an effective group id of a group having PRIV_RTPRIO access to be a realtime process (see getprivgrp(2)) or be super user.  Simply reading realtime priorities requires no special privilege. 

Real time scheduling policies differ from the normal timesharing policies in that the realtime priority is used to absolutely order all realtime processes; this priority is not degraded over time.  All realtime processes are of higher priority than normal user processes, although some system processes may run at realtime priorities themselves.  If there are several eligible processes at the same priority level, they will be run in a round robin fashion as long as no process with higher priority intercedes.  A realtime process will receive cpu service until it either voluntarily gives up the cpu or is preempted by a process of equal or higher priority.  Interrupts may also preempt a realtime process. 

Valid realtime priorities run from zero to 127.  Zero is the highest (most important) priority.  This realtime priority is inherited across forks and execs. 

Prio specifies the following:

0−127 Set process to this realtime priority. 

RTPRIO_NOCHG
Do not change realtime priority. This is used for reading the process realtime priority.

RTPRIO_RTOFF
Set this process to no longer have a realtime priority.  It will resume a normal timesharing priority. Any process, regardless of privilege, is allowed to turn off its own realtime priority using  a pid of zero. 

RETURN VALUE

If no error occurs, rtprio will return the pid’s former (before the call) realtime priority.  If the process was not a realtime process, the value RTPRIO_RTOFF will be returned. If an error does occur, -1 is returned and errno is set to one of the values described in the ERRORS section. 

ERRORS

[EINVAL] Prio is not RTPRIO_NOCHG, RTPRIO_RTOFF or in the range 0 to 127. 

[ESRCH] No process can be found corresponding to that specified by pid. 

[EPERM] The calling process is not the super−user and neither its real or effective user−id match the real or effective user−id of the process indicated by pid. 

[EPERM] The calling process is not a member of a group having PRIV_RTPRIO capability and prio is not RTPRIO_NOCHG, or RTPRIO_RTOFF with a pid of zero. 

HARDWARE DEPENDENCIES

Series 500:

Some of the work done by the system on behalf of users is done with daemon processes which have varioius priorities.  Some functions such as copying user space on a fork, virtual memory swapping, and LAN activity are done at a priority lower than any of the rtprio(2) priorities. 

Other functions, such as terminal I/O, disc I/O, DIL interrupts, signals, select(2) wakeups, and system timers, are done at a priority level equivalent to an rtprio(2) priority of 64. 

If there is a real-time process that is consuming all available CPU time, the system will not be able to accomplish any other system activities that have a lower priority, even if the function is on behalf of the real-time process.  In the case of multi-CPU systems, it will take multiple real-time processes to lock out the system. 

The user of rtprio(2) must decide whether the task requiring real-time priorities needs to have an effective priority greater than or less than the system functions provided. 

SEE ALSO

rtprio(1), getprivgroup(2), plock(2),nice(2). 

NOTES

Normally, compute bound programs should not be run at realtime priorities, because all time sharing work on the cpu would come to a complete halt. 

Hewlett-Packard  —  last mod. May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026