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 AIX 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.
Under this implementation, the priorities vary according to the scheduling policy, as shown in Table 3.
Table 3 – AIX with POSIX 1003.1c: Scheduling policy priority values
Scheduling Policy
Minimum Priority
Maximum Priority
Default Priority
RW_THR_PREEMPTIVE
1
127
1
RW_THR_TIME_SLICED_FIXED
1
127
1
RW_THR_TIME_SLICED_DYNAMIC
1
127
1
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.
The AIX POSIX threads implementation ignores attempts to set the priority if the thread scope is RW_THR_SYSTEM_SCOPE and the scheduling policy is RW_THR_TIME_SLICED_DYNAMIC. Threads with this scheduling policy are subject to continuous priority adjustments.
The allowed range of priorities on AIX is different from the priorities that are actually used. A priority in the range of 1 to 39 results in a priority of 40, and a priority in the range of 81 to 127 results in a priority of 80. So the effective range of priority values is 40 to 80. Only privileged users can set a priority greater than 60.