The task mechanism allows you to integrate continuous or synchronized code into the primitive activity. For this purpose, Rational Statemate provides a special library that extends the C language to support tasking or multi-threading. (See the Scheduler section below, for details). Tasks can also be bound to either a primitive or an external activity.
The scheduler package allows you to define C functions as concurrent routines or co-routines. An activity that you choose to implement as a task is started by the control code as a co-routine, which is executed concurrently with the rest of the prototype. Since we are dealing with serial machines, concurrency means that the control is switched between these co-routines without interrupting their thread of control. That is, when the co-routine gets the control back, it resumes executing with the exact context it was before.
This mechanism allows the activity to use delay statements, wait for events, and perform continuous calculations without blocking the rest of the code from continuing execution. When a task is executed, however, the rest of the code is frozen. Thus, synchronization points are introduced. They allow the rescheduling of other tasks (or the control code) to proceed and actions (stop, suspend) to take effect.