Scheduler Operations

To enqueue and dequeue tasks is simple: The task is placed or respectively removed from the appropriate list selected by array->queue + p->prio, and the corresponding bit in the bitmap is set if at least one task is present, or removed if no tasks are left on the queue. Notice that new tasks are always queued at the end of each list.

The two interesting operations are how the next task is selected and how preemption is handled. Consider pick_next_task_rt, which handles selection of the next task first. The code flow diagram is shown in Figure 2-24.

33SMP systems require some more elements for load balancing, but these do not concern us here.

pick_next_task_rt 1


Dequeue task

Set se.exec_start

Continue reading here: Figure 224 Code flow diagram for picknexttaskrt

Was this article helpful?

0 0