feat(scheduler-core): implement builtin_fcfs session and post-allocation hooks (task 2.3)
Adds begin_session/next_job/end_session/on_dispatch/on_pend, driving a dual-cursor walk (queue then job) over builtin_fcfs's private ordq_t state. next_job() returns candidates in (queue priority desc, job priority desc, queue_time asc) order and NULL once exhausted; on_dispatch removes permanently, on_pend is a true no-op. Review flagged an unsynchronized cross-thread access risk between next_job() (picker thread) and on_dispatch/on_pend (allocator thread) once wired live in task 2.4 — recorded in tasks.md Implementation Notes for that task to close before registering builtin_fcfs as the default. Requirements: 3.2, 3.4, 3.6
This commit is contained in:
parent
b7214ebe88
commit
fcb32a8b30
5 changed files with 658 additions and 8 deletions
|
|
@ -32,6 +32,27 @@
|
|||
#include "plugin.h"
|
||||
#include "sched/types.h"
|
||||
|
||||
/* builtin_fcfs.c's next_job() (task 2.3) calls sched_queue_is_ready()/
|
||||
* sched_job_is_ready() (declared in scheduler.h, defined in scheduler.c),
|
||||
* which this translation unit does not link -- same as every other
|
||||
* white-box picker test in this directory that #includes builtin_fcfs.c
|
||||
* directly. This file's own tests (tasks 2.1/2.2) never call next_job(), so
|
||||
* a simple always-ready stub (mirroring scheduler.c's own current stub,
|
||||
* scheduler.c:1267/1270) is enough to satisfy the linker;
|
||||
* test_picker_fcfs_session.c is where the real skip-when-not-ready behavior
|
||||
* is exercised, via controllable test doubles. */
|
||||
int sched_queue_is_ready(xce_sched_queue_t* q)
|
||||
{
|
||||
(void)q;
|
||||
return 1;
|
||||
}
|
||||
|
||||
int sched_job_is_ready(xce_sched_job_t* j)
|
||||
{
|
||||
(void)j;
|
||||
return 1;
|
||||
}
|
||||
|
||||
#include "../src/plugins/builtin_fcfs.c"
|
||||
|
||||
void setUp(void) { return; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue