Scheduling Priority
In POSIX 1003.1c-compliant systems, support for the specification of thread priority is optional. The Threads Module determines whether scheduling priority is supported by testing for the definition of the macro _POSIX_THREAD_PRIORITY_SCHEDULING.
The HP POSIX implementation does support priority scheduling. The Threads Module uses the standard POSIX.1b (formerly POSIX.4) functions sched_get_priority_min() and sched_get_priority_max() to determine the legal range of priority values.
The default priorities assigned by the Threads Module and the ranges reported by these functions are as follows:
Table 6 – HP-UX with POSIX 1003.1c: Scheduling policy priority values 
Scheduling Policy
Minimum Priority
Maximum Priority
Default Priority
RW_THR_PREEMPTIVE
0
31
0
RW_THR_TIME_SLICED_FIXED
0
31
0
RW_THR_TIME_SLICED_DYNAMIC
-256
-129
N/A
A new thread’s priority value is inherited from the creating thread by default, unless the priority attribute has been explicitly set or the inheritance policy has been changed from its default value of RW_THR_INHERIT to RW_THR_EXPLICIT. If the inheritance policy is RW_THR_EXPLICIT, the Threads Module defines the default priority to be the minimum priority. HP’s implementation ignores attempts to set the priority if the scheduling policy is SCHED_OTHER (RW_THR_TIME_SLICED_DYNAMIC); threads with this scheduling policy are subject to continuous priority adjustments.
The priority of any thread may not be changed unless the process has root privileges or is a member of a group with the RTPRIO privilege.