I've found:
pthread_setschedprio()
here: http://www.kernel.org/doc/man-pages/online/pages/man3/pthread_setschedprio.3.html
But I can't find any valid values for thread priority. For Windows I've found very clear possible value, like:
THREAD_PRIORITY_BELOW_NORMAL
THREAD_PRIORITY_NORMAL
THREAD_PRIORITY_ABOVE_NORMAL
but for Mac OS I didn't found anything. I can't use Cocoa NSThreads class, I need to use POSIX threads.
Do you know how to set thread priority pthreads on Mac OS?
AFAIK pthread_setschedprio() doesn't exist on macOS. You can only set the priority of a thread when you create it using pthread_setschedparam().
And as for priority, see documentation for pthread_setschedparam():
Valid thread priorities (accessed via param->sched_priority) must be within the range returned by the
sched_get_priority_min(2)andsched_get_priority_max(2)system calls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With