GDSX Manual
LINE^HANDLER Example, Design
Extended General Device Support (GDSX) Manual–134303
7-2
Environment of an Executing LINE^HANDLER Task
ITC file numbers are not actual Guardian file numbers, but values assigned by TSCODE 
to DEVICE^HANDLER tasks whose messages are to be routed to associated 
LINE^HANDLER tasks. See Figure 7-3 for an illustration of LINE^HANDLER 
message flow. When TSCODE receives an I/O request from a DEVICE^HANDLER 
task, it examines the file number in the variable term^file^num. If term^file^num is a 
Guardian file, the I/O request is sent directly to the IOP. However, if the file number is 
an ITC file, the request is sent to the associated LINE^HANDLER task. 
Thus in this example, term^file^num represents a thread from the DEVICE^HANDLER 
task through the ITC file to the LINE^HANDLER task, and then to the terminal. 
DEVICE^HANDLER tasks are unaware of LINE^HANDLER tasks and intertask 
communication with LINE^HANDLER tasks. The DEVICE^HANDLER sends 
messages to term^file^num, just as it would if there were no LINE^HANDLER, and 
TSCODE handles the routing of the message to the LINE^HANDLER. 
In Section 6, after a terminal file number was assigned, TSCODE called the 
DEVICE^HANDLER procedure, creating a DEVICE^HANDLER task and passing the 
terminal file number as a parameter. The task read from, and replied to, incoming 
messages by way of a pseudo-$RECEIVE file (with GDSX internal file number 0), 
which TSCODE automatically opened for the task just before creating the task.
The layer of software called pseudo procedures described in Sections 4 and 5 on the 
DEVICE^HANDLER example is also used with LINE^HANDLER tasks. Both 
DEVICE^HANDLER and LINE^HANDLER tasks should avoid directly calling the 
Guardian file-system I/O procedures, because if any user task initiated a waited 
operation, processing for all other tasks would also be suspended, disrupting 
multithreaded operation. 
Figure 7-1. LINE^HANDLER Run-Time Environment
Requester
$GDS
D^H Task
D^H Task
Monitor
Listener
$RECEIVE
D^H Task
L^H Task
IN^QUEUE^
FILE^NUM
LINE^
FILE^
NUM
Requester
Requester
TSCODE










