Scheduling policies
Now, suppose that two threads are capable of using the CPU and have the exact same priority. Let's assume that one of the threads is currently using the CPU. We'll examine the rules that the kernel uses to decide when to context-switch in this case.
(Of course, this entire discussion really applies only to threads at the same priority—the instant that a higher-priority thread is ready to use the CPU it gets it; that's the whole point of having priorities in a realtime operating system.)
The two main scheduling policies (policies) that the microkernel
understands are Round Robin (or just RR
) and FIFO (First-In, First-Out).
(There's also sporadic scheduling, but it's beyond the scope of this book; see
Sporadic scheduling
in the QNX OS Microkernel chapter of the
System Architecture guide.)