On 2010/09/23 12:06, Edd Barrett wrote: > On Thu, Sep 23, 2010 at 11:40:38AM +0100, Stuart Henderson wrote: > > we have support for thread priorities, see src/lib/libpthread/uthread/ > > and pthreads(3), just not the sched_get_priority_*() functions. > > Good, thanks for clarifying. > > > it might make sense to add them though, we have patches in a few > > ports for this: > > Adding this function would be the correct fix. These patches appear to > just workaround the real issue. > > Is there any harm in also adding MAX/MIN to the pthread header? This will > allow > us to rid of magic numbers until the function becomes available.
I don't see the point in that, it just means swapping one patch for another. If anything is added it should be the standard system calls so the patches can just be removed. http://www.opengroup.org/onlinepubs/000095399/functions/sched_get_priority_max.html I see we do already have implementations for linux emulation, see /sys/compat/linux/linux_sched.c, which returns 0 for both min and max.
