GDSX Manual

Design and Development
Extended General Device Support (GDSX) Manual134303
2-11
Calling Restrictions
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.
Calling Restrictions
User code is compiled to produce an object file that is bound with TSCODE, so there are
restrictions to which user code must conform.
Multithreaded operation would not be possible within GDSX if user tasks called
Guardian I/O procedures in a waited manner. For example, if a DEVICE^HANDLER
task called a waited READ, the whole process, not just the one DEVICE^HANDLER
task, would come to a halt, and the other tasks could not be serviced during the
suspension.
Therefore, TSCODE provides you with a set of pseudo Guardian, Pathway/TS, and
NonStop TM/MP procedure calls that, with some exceptions, have the same parameters,
syntax, meaning, and resultant capabilities as their Guardian, Pathway/TS, and NonStop
TM/MP counterparts. These procedures comprise a layer of TSCODE software between
USCODE and Guardian systems that is virtually transparent to USCODE, while
allowing TSCODE to support multithreaded operation and keep track of each internal
I/O operation. Pseudo procedures determine whether an operation is to be handled
completely within GDSX or is to be handled outside GDSX.
Note that a number of Guardian procedures—NUMIN, NUMOUT, MYTERM, and
PROCESSHANDLE_DECOMPOSE_, for example—are resident system procedures
and do not cause the GDSX process to be suspended. Therefore, they can be called by
USCODE. As a rule, if a Guardian call would suspend not just a task but the whole
GDSX process, do not use it.
Following is a list of pseudo procedure calls supported by TSCODE. (Many TSCODE-
supported utility procedures do not have Guardian file-system counterparts, and are not
included here. See Section 8, “Service Routines,for a description of all TSCODE-
supported procedures.) An X at the end of or in the middle of a procedure name
indicates that both local-memory and extended-memory procedures are available. For
Caution. The pseudo Guardian, Pathway/TS, and NonStop TM/MP procedure calls must be
used instead of their counterparts.