GDSX (Extended General Device Support) Manual

Design and Development
Extended General Device Support (GDSX) Manual529931-001
2-97
Intertask Communication
The IOCB is deallocated.
Intertask Communication
The intertask communication (ITC) facility was implemented to enable
DEVICE^HANDLER tasks to have a device-oriented interface to subdevices on a line
or to communicate with other DEVICE^HANDLER or LINE^HANDLER tasks without
using the Guardian file and message system. ITC communication is also possible
between LINE^HANDLER tasks.
The first consideration for this type of facility is the allocation of device file numbers.
File numbers F in the range:
(MAXFILES - MAXTSK + MAXLINES + 5)< F <= MAXFILES
are reserved for ITC files. If a TSCODE call to the Guardian procedure OPEN returns
a file number in this range, ^OPEN closes the file and returns file error 32
(FENOCBSPACE) to the calling task’s ^FILEINFO(-1,..).
When initiating a new user task, TSCODE allocates the largest currently unused
number in the ITC range and assigns it as that task’s file number. The FCB for the file
is set up as follows:
So that GDSX $RECEIVE handling would not need to be changed, a file separate from
$RECEIVE was used for the LINE^HANDLER’s input queue. The actual value passed
to each LINE^HANDLER in the in^queue^file^num parameter is MAXFILES + 1.
When a DEVICE^HANDLER task initiates an I/O operation, the TSCODE-supported
service routines examine the file number passed to them. If the number is in the ITC
range, the request is routed to the associated LINE^HANDLER task by a call on the
procedure SEND^ITC^MSG.
The SEND^ITC^MSG procedure allocates an IOCB and links it to the
DEVICE^HANDLER’s TCB and the ITC file’s FCB, just as the IOCB would be for a
Guardian file. If the LINE^HANDLER has a current ^READUPDATE on its ITC file, the
IOCB is also linked to the LINE^HANDLER’s ITC request queue. The I/O initiation is
completed by causing the LINE^HANDLER’s ITC event.
LINE^HANDLER Processing
After the LINE^HANDLER task’s WAIT^EVENT returns E^ITC, the task calls
^LISTEN(0,0,1). ^LISTEN looks at the LINE^HANDLER’s ITC request queue; if the
queue is nonempty, the first element in the queue is delinked from the queue, its state
is changed to 6 (active), and its address is returned.
fcb.public 0
fcb.lhaddr Address of LINE^HANDLER’s TCB
fcb.owner Address of DEVICE^HANDLER task’s TCB
fcb.type 1