enum job_state { done, // already done, nothing to do running, // job is running waiting, // waits for some resource (annother job) rejected, // sorry, cant do that dave, time will run out expired, // time expired aborted // got aborted }
The purpose of the Scheduler is to run small self contained Jobs ordered by priority and observing specific timing constraints.
Use multiple priority queues
background work
foreground high-priority
soft-realtime actions
A job is a closure to run a small and limited action or operation, which in itself should not block. Job may depend on each other and on resources to be provided. A job may be conained in multiple queues and may be marked as canceled — in which case the job function will never run and the job will be discarded on occasion.
enum job_state { done, // already done, nothing to do running, // job is running waiting, // waits for some resource (annother job) rejected, // sorry, cant do that dave, time will run out expired, // time expired aborted // got aborted }