Previous: Note and ScoreList Up: A Bestiary of Kiwi Objects Next: InstrTable
Figure 2.5. Interaction between Note, Scorelist and Task
In many operating systems, a processor sits idle until the scheduler gives it a task. Kiwi reverses this approach; when a Processor is idle, it calls Scheduler::get_task, which returns a pointer to a Task. The Processor executes the Task by calling Task::doit. A Kiwi Task has the form ``compute samples for Note starting at time and ending at time .'' Task::doit computes these samples and stores them in the Task buffer. When the Task finishes, they are copied into the Collector buffer (Figure 2.5 illustrates the relationship between Note, ScoreList, Processor, and Task).
Most Tasks compute samples for an entire Note, and the Task start and end times will match those of the Note. However, for reasons discussed below, it is sometimes necessary to divide a single Note into several Tasks, with the starting and ending times of those Tasks arranged to split the Note into contiguous parts.
Comments to walker@shout.net