GDSX (Extended General Device Support) Manual
Design and Development
Extended General Device Support (GDSX) Manual—529931-001
2-11
Overview of GDSX Processing
11. If GDSX is run as a process pair, the backup task starts the backup process, and
in the backup process TSCODE calls user exits in the following order:
a. USER^INIT^CONFIG^PARAMS
b. USER^VERSION
c. USER^INITIALIZE
12. If GDSX is run as a process pair, in the primary process TSCODE checkpoints
data to the backup, then calls USER^BACKUP.
When GDSX receives an open message for a file from an external process (for
example, a TCP dynamically opening a terminal), a user task is created. The listener
task creates an open system task to process the external open, and the task opens the
requested subdevice. Any errors encountered during the open are passed back to the
external process. If the open proceeds without error, the open task is relaunched as a
user task (either a DEVICE^HANDLER task or a LINE^HANDLER task).
User tasks never exit back to the procedure that first called them. Instead, they
execute in a perpetual loop, and when they require TSCODE services, they call an
appropriate TSCODE service routine (see Section 8, Service Routines). These service
routines provide facilities similar to those provided by the operating system, yet allow
TSCODE to keep track of each internal I/O operation and to ensure that every I/O
operation is handled correctly at completion time.
When a user task calls one of these routines, control is transferred to the TSCODE
kernel. TSCODE either passes the procedure call on to the operating system or
performs the requested function internally, returning immediately to the user task.
In other cases the routine has to wait for some external event (for example, the
completion of I/O). The service routine then transfers control to the kernel, which
determines whether another task is ready to run. (When TSCODE eventually wakes
up the calling task to resume execution, control is returned to the task at the instruction
immediately following the procedure call.) The kernel saves the current task stack and
then checks to see if another task is ready to run. If another task is ready, the kernel
restores the stack of the ready task and exits back into it. If no task is ready to run, the
kernel waits for I/O completion on any file. When an I/O completes, the kernel
determines which task initiated it (or in the case of $RECEIVE, which task the request
is directed to) and reinstates the task (by restoring the task stack and exiting back into
it).
If the external opener closes a file, the listener task places the user task that manages
the file in a stopping state so that the file may be closed and the task terminated. The
user task does not participate in this close process. However, TSCODE calls the
USER^STOP user exit to allow USCODE to clean up the file before TSCODE closes
the file and terminates the task.