GDSX Manual
Extended General Device Support (GDSX) Manual–134303
7-1
7
LINE^HANDLER Example, Design
The previous section described how to run and manage a LINE^HANDLER example
program. This section contains a description of the environment of an executing
LINE^HANDLER task and an analysis of the design of the LINE^HANDLER example,
including the typical structure used by a LINE^HANDLER task for communication with
the DEVICE^HANDLER tasks and the IOP.
Environment of an Executing LINE^HANDLER
Task
The LINE^HANDLER example program has customized DEVICE^HANDLER,
LINE^HANDLER, and USER^STOP procedures. The DEVICE^HANDLER and
USER^STOP procedures in this example are identical to the DEVICE^HANDLER and
USER^STOP procedures described in the example of Sections 4 and 5.
The DEVICE^HANDLER tasks perform datastream conversion. The function of the
LINE^HANDLER task is to manage communication to the shared resource, a terminal
in this example, so that the requester threads do not interfere with each other.
Figure 7-1 illustrates the tasks in this example’s environment. (D^H represents a
DEVICE^HANDLER task and L^H represents a LINE^HANDLER task.)
In the previous section’s exercise, after the GDSX process was run, SCF was used to
configure a LINE object. The LINE is configured before the SU objects, because the
SU objects must be configured under the LINE object. Then three SU objects were
configured under the LINE, and the LINE object was started.
When the LINE was started, TSCODE opened the line file $TC1, in this case given by
the access name, and assigned to the file a file number to be used by the
LINE^HANDLER task to address the file. The number assigned is the actual Guardian
file number for the device.
TSCODE also created a $RECEIVE-like file with a file number for the
LINE^HANDLER task to use when picking up messages from the
DEVICE^HANDLER tasks. TSCODE then called the LINE^HANDLER procedure,
thereby creating a LINE^HANDLER task to manage the LINE object. Two parameters
supplied when calling the procedure were line^file^num and in^queue^file^num.
When a requester process was started, TSCODE determined that the SU to be opened
was under a line, opened the specified SU, and notified the LINE^HANDLER task that
the SU had been opened. A file number was then assigned for use by the
DEVICE^HANDLER task (which was about to be created) when communicating with
the terminal to which it would be mapped. Because T1 was configured under a LINE
object, the file number assigned was an ITC file number.