Commit 43f9499
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 3d94a32 commit 43f9499
2 files changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
| |||
108 | 112 | | |
109 | 113 | | |
110 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
111 | 124 | | |
112 | 125 | | |
113 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| |||
0 commit comments