pthread sched_get_priority_min/max implementation for SCHED_OTHER/SCHED_FIFO

后端 未结 1 1356
遇见更好的自我
遇见更好的自我 2021-02-06 15:05

I\'m trying to write a semi-portable threading class for a project I\'m working on, and while trying to set the priority of a thread, I came across a conundrum in the pthread wo

相关标签:
1条回答
  • 2021-02-06 15:21

    The range of priorities you get in Ubuntu (as well as any other Linux-based OS) for SCHED_OTHER is [0,0] which is a valid range. This means all of these non-realtime processes have the same 'priority' and their only difference is in their 'nice' value.

    See the nice system call for more info. I am not sure how OpenBSD's scheduler works, but nice() syscall is in POSIX and it should supported in UNIX systems.

    0 讨论(0)
提交回复
热议问题