Firmware · RTOS: tasks and scheduling
With several tasks competing for a processor, each task's priority and state determine which one gets to run at any moment.