Skip to content

Scheduler implementation

Alexey Ozeritskiy edited this page Oct 14, 2026 · 1 revision

Scheduler implementation

Implementation reference checked against f5e786f. Fundamental explanations remain in docs/arch.

The current runtime is a scheduled graph, not a recursive runtime-node tree. plan_lowerer.cpp builds tasks and connections; state.h defines ITaskNode::Execute and the task results; connection.h defines one-to-one, gather, hash-shuffle, and broadcast transports.

ETaskResult is OK, NEED_DATA, BLOCKED_OUTPUT, or FINISHED. The worker state is Idle/Queued/Running/Reschedule/Finished. A wakeup during execution must be recorded, and the same task cannot execute concurrently on two workers.

Task implementations and operator adapters are in runtime_adapter.cpp. The threaded policy is in threaded_scheduler.cpp. WantsInput supports selective producer wakeup for build-first joins; TryNotifyDependency handles publication dependencies.

Current defaults include 4 rowset slots per ordinary connection lane, a 1024 ready-queue capacity, and the scan/shuffle/aggregate settings in settings.h. Use --scheduler-counters to inspect rescheduling, input waits, output blocking, and ready-queue work.

The detailed task/processor tables and earlier JS dispatcher proposals removed from architecture prose are preserved in the migration archive. Those proposals include old pull-shell types and are not current runtime APIs.

Clone this wiki locally