4
votes

I'm a bit confused between thread vs process scheduling.

I've read about process scheduling policies at

http://man7.org/linux/man-pages/man2/sched_getscheduler.2.html

and I've read about thread scheduling at

http://man7.org/linux/man-pages/man3/pthread_getschedparam.3.html

Do threads inherit scheduling policy from their process? Is it possible to set process scheduling to SCHED_OTHER, and then set one of that process's threads to SCHED_FIFO ? I understand the policies independently but don't understand the thread/process relationship. Nay insight?

1

1 Answers

5
votes

Linux does not support process scheduling at all. Scheduling is entirely on a thread basis. The sched_* functions incorrectly modify the thread scheduling parameters of the target thread id instead of the scheduling parameters of a process. See:

http://sourceware.org/bugzilla/show_bug.cgi?id=14829 and http://sourceware.org/bugzilla/show_bug.cgi?id=15088