At certain times, you may need to suspend execution of your task (that is, enter a wait state) until some specific event is completed. The most frequent event is I/O. Typically, the wait is automatically handled by DC, which puts the task in a wait state and, upon completion of the I/O, places the task in a ready state.
You can define an event simply by naming the event in a wait request. DC, upon receiving the wait request, places your task in a wait state. The task is returned to a ready state when another task (the task performing the event), upon completion, posts the event by name. One typical use of user-defined events is to synchronize the concurrent execution of different tasks; for example, a terminal task and a concurrent nonterminal task.
Steps to Establish and Post an Event
To place a task in a wait state, waiting for the completion of an event, perform the following steps:
Copyright © 2013 CA.
All rights reserved.
|
|