A prerequisite-based scheduler is disclosed which takes into account
system resource prerequisites for execution. Tasks are only scheduled
when they can successfully run to completion and therefore a task, once
dispatched, is guaranteed not to become blocked. In a prerequisite table,
tasks are identified horizontally, and resources needed for the tasks are
identified vertically. At the bottom of the table is the system state,
which represents the current state of all resources in the system. If a
Boolean AND operation is applied to the task prerequisite row and the
system state, and if the result is the same as the prerequisite row, then
the task is dispatchable. In one embodiment of the present invention, the
prerequisite based scheduler (dispatcher) walks through the prerequisite
table from top to bottom until a task is found whose prerequisites are
satisfied by the system state. Once found, this task is dispatched.