Supplementing Generated C : Scheduler Package

Scheduler Package

The user can specify that some of the primitive activities are to be implemented as tasks in the Profile Editor. The tasks are actually C functions invoked as co-routines. The statechart code itself is a task, which runs concurrently with the other invoked tasks.

Controlling all those tasks is the responsibility of statecharts which issue different actions to the different activities (for example, start, stop, suspend, resume). All this is handled by a scheduler package which is supplied with the Code Generator and is available on Rational Statemate platforms only. This package supports multi-tasking programming within the context of a single process.

Below we describe how the user may add his own tasks, apart from those created for each task-like primitive activity, and how to use the scheduler for controlling them.