Causes of Events

Normally, the CAUSE statement also sets the happened state of the event to TRUE (happened). For an explanation of exceptions to this condition, see WAITANDRESET Statement.

If an enabled interrupt is attached to the event, each cause of the event results in one execution of the interrupt code.

Activating a task does not necessarily place the task into immediate execution. Activating a task consists of delinking the task from an event queue (each event has its own queue) and linking that task in priority order into a system queue called the ready queue.

The ready queue is a queue of all tasks that are capable of running. Tasks are taken out of the ready queue either when a processor is assigned to the task or when the task must wait for an operation (such as an I/O operation) to complete or for an event to be caused. A task is placed in execution only when it is the top item in the ready queue and a processor is available.

When a program causes a happened event, the CAUSE statement is ignored (a no-op is caused); the system does not remember every cause unless an interrupt is attached to the event. For more information on events, see EVENT Statement.