Synchronization & Scheduling

The heart of the synchronization and scheduling system is built using two components : a scheduler and a synchronizer.

The scheduler allows to schedule tasks which dates are expressed in ticks units. It interacts with the synchronizer component which provides ticks to real-time conversion functions. The scheduler interacts with the synchronizer to check if tasks can be scheduled and to convert dates expressed in ticks values in dates in millisecond. The synchronizer maintains the current tempo and converts dates for the scheduler. When the tempo change the synchronizer forces the scheduler to reschedule pending tasks. Several kind of synchronizer are available :

The scheduler maintains a list of tasks to be scheduled and use the MidiShare normal task scheduling mechanism. There is no time sorting algorithm implemented in the current ticks scheduler, so this model may not be efficient enough for a general tick scheduling mechanism. It's sufficient for a sequencer because only a few number of tasks will be inserted at the same time in the scheduler.