Supplementing Generated Ada : Synchronization of Primitive Activities : Procedures

Procedures

A procedure-activity is executed in a one-shot - it is not preempted until it returns. Therefore, you should use this mechanism for instantaneous activities (activities that execute for a short period of time). Typically, these activities perform short calculations or non-blocking I/O operations, like displaying data or drawing graphics. If the procedure mechanism is used for continuous calculations or delayed I/O, it blocks the rest of the prototype from reacting properly to incoming events. Since a procedure-activity is not being preempted, the suspend, stop and resume actions do not have any effect on them. When a procedure-activity returns, the sp!( ) event is sent to the controlling code.