The present invention provides providing predictable scheduling of
programs using repeating precomputed schedules on discretely scheduled
and/or multiprocessor operating systems. In one embodiment, a scheduler
accesses an activity scheduling graph. The activity scheduling graph is
comprised of nodes each representing a recurring execution interval, and
has one root, one or more leaves, and at least one path from the root to
each leaf. Each node is on at least one path from the root to a leaf, and
the number of times the execution interval represented by each node
occurs during the traversal of the graph is equal to the number of paths
from the root to a leaf that the node is on. Each node has associated
with it an execution interval length, and is adapted to being dedicated
to executing the threads of a single activity. There may be one
scheduling graph for each processor, or a scheduling graph may traverse
multiple processors. Start and end times for reservations and constraints
are adjusted to compensate for the granularity of the clock of the
system. Furthermore, the scheduler may use an existing priority-based
scheduler in order to cause scheduling decisions it has made to be acted
upon.