A thread's priority setting.
#include <prthread.h> typedef enum PRThreadPriority { PR_PRIORITY_FIRST = 0, PR_PRIORITY_LOW = 0, PR_PRIORITY_NORMAL = 1, PR_PRIORITY_HIGH = 2, PR_PRIORITY_URGENT = 3, PR_PRIORITY_LAST = 3 } PRThreadPriority;
PR_PRIORITY_FIRST
PR_PRIORITY_LOW
PR_PRIORITY_NORMAL
PR_PRIORITY_HIGH
PR_PRIORITY_NORMAL
. This priority is for threads performing work of high urgency but short duration.PR_PRIORITY_URGENT
PR_PRIORITY_LAST
In general, an NSPR thread of higher priority has a statistically better chance of running relative to threads of lower priority. However, because of the multiple strategies NSPR uses to implement threading on various host platforms, NSPR priorities are not precisely defined. At best they are intended to specify a preference in the amount of CPU time that a higher-priority thread might expect relative to a lower-priority thread. This preference is still subject to resource availability and must not be used in place of proper synchronization.