Commit 69421e4
committed
Add data structures for O(1) scheduler
This commit extends the core scheduler data structures to support
the new O(1) scheduler design.
Adds in tcb_t:
- rq_node: embedded list node for ready-queue membership used
during task state transitions. This avoids redundant malloc/free
for per-enqueue/dequeue nodes by tying the node's lifetime to
the task control block.
Adds in kcb_t:
- ready_bitmap: 8-bit bitmap tracking which priority levels have
runnable tasks.
- ready_queues[]: per-priority ready queues for O(1) task
selection.
- queue_counts[]: per-priority runnable task counters used for
bookkeeping and consistency checks.
- rr_cursors[]: round-robin cursor per priority level to support
fair selection within the same priority.
These additions are structural only and prepare the scheduler for
O(1) ready-queue operations; they do not change behavior yet.1 parent 0ce5a6c commit 69421e4
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
107 | 120 | | |
108 | 121 | | |
109 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
0 commit comments