GDSX (Extended General Device Support) Manual
LINE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual—529931-001
7-6
Intertask Communication—LINE^HANDLER
Perspective
The event descriptions and the global literals (declared in DCCBDECS (EVENTS))
used by TSCODE to define the events are given in Table 7-1. Events having an IOCB
associated with them are marked in the fourth column.
After TSCODE passes a value to the LINE^HANDLER task to indicate what event
occurred, if the event has an IOCB associated with it, the task can call ^LISTEN to get
a pointer to the IOCB. To get the IOCB pointer for a message from a
DEVICE^HANDLER task, use the statement:
@IOCB := ^LISTEN (0, 0, 1);
The third parameter value of 1 indicates an intertask communication.
To get the IOCB pointer for a message passed by TSCODE directly from $RECEIVE,
use the statement:
@IOCB := ^LISTEN (1, 0, 0);
The first parameter value of 1 indicates a message from $RECEIVE.
To get the IOCB pointer for an I/O completion on a file, use the statement:
@IOCB := ^LISTEN (0, i-o-message, 0);
where a nonzero i-o-message is interpreted as a file number from TSCODE for
which the procedure is to look for completed I/Os. A value of -1 for i-o-message
indicates that ^LISTEN looks for all completed I/Os except those for intertask requests
and messages from $RECEIVE.
A method for getting the IOCB for a canceled request is discussed in the next
subsection.
Table 7-1. Events Detected With WAIT^EVENT
Event Description Literal Identifier
Literal
Constant
Associate
d IOCB
No event: timeout occurred E^TIMEOUT 0
Request that L^H call STOP^TASK E^STOP 1
Resume processing E^CONTINUE 2
Intertask message or I/O canceled E^CAN 3 X
Message arrived from $RECEIVE E^IMSG 4 X
Intertask message arrived E^ITC 5 X
Completion of I/O other than $RECEIVE and
intertask message
E^IOC 6 X
Resource is available E^RESOURCE 7
Device added, deleted, altered, started, or
stopped
E^CHANGE 8