Priorities and scheduling

Updated: May 06, 2022

Although there's a good discussion of priorities and scheduling policies in the System Architecture manual, it will help to go over that topic here in the context of a programmer's guide.

The QNX Neutrino RTOS provides a priority-driven preemptive architecture. Priority-driven means that each thread can be given a priority and will be able to access the CPU based on that priority. If a low-priority thread and a high-priority thread both want to run, then the high-priority thread will be the one that gets to run.

Preemptive means that if a low-priority thread is currently running and then a high-priority thread suddenly wants to run, then the high-priority thread will take over the CPU and run, thereby preempting the low-priority thread.

On a multicore (SMP) system, QNX Neutrino still runs the highest-priority runnable thread on one of the available cores. Additional cores run other threads in the system, though not necessarily the next highest-priority thread or threads.