Scheduling policies can have different ranges of priorities?
Dale Stanbrough wrote: > I read somewhere that different scheduling policies can have > different ranges of priorities, and that symbolic values should > be used to represent min/max priorities. > > Is this correct, and if so where can i find the definition of > these priorities? Presuming that you’re talking about POSIX threads, the only way to find the legal range of POSIX priority values for a given policy is by calling sched_get_priority_min() and sched_get_priority_max(). (Each takes a single int argument, the symbol for the policy, such as SCHED_FIFO, and returns an int priority value.) One minor complication is that these interfaces are under the _POSIX_PRIORITY_SCHEDULING option, and are not required for the _POSIX_THREADS option or the _POSIX_THREAD_PRIORITY_SCHEDULING options; thus, you could possibly find realtime threads scheduling support WITHOUT any supported/portable way to determine the priority ranges. (I actually tried to get that fixed, but nobody else seemed to care