Can we use SCHED_OTHER and SCHED_RR for two threads, if so how will the CPU handle the threads with policy of Non-Realtime and Realtime.
Multiple scheduling policies usage
230 views Asked by Gughan At
2
There are 2 answers
0
On
What @janneb said is true for the Linux implementation of POSIX. But since this question was also tagged posix, I shall quote what POSIX 7 says about it:
The effect of scheduling threads with the SCHED_OTHER policy in a system in which other threads are executing under SCHED_FIFO, SCHED_RR, or SCHED_SPORADIC is implementation-defined.
So what I can interpret from that is that POSIX does not specify what happens.
The realtime thread (with
SCHED_RR, that is) will always preempt the non-realtime one (withSCHED_OTHER, that is).In other words, the
SCHED_OTHERthread will only get a chance to run when the SCHED_RR thread is blocked.