Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 26
Creating a Process in a Nowait Manner
Creating a Process in a Nowait Manner
If you call the PROCESS_LAUNCH_ procedure with the NOWAIT_TAG field of the
input parameter structure set to any value other than -1, your process returns
immediately without waiting for completion of the operation. Instead, your process
receives notification with system message -102 (the nowait PROCESS_LAUNCH_ or
PROCESS_CREATE_ completion message) when the operation finishes.
The format of system message -102 was shown earlier as it is defined in the ZSYSTAL
file; its format is the same as that of the PROCESS_LAUNCH_ output parameter
structure. The structure of system message -102 is shown below as an array:
The following example creates a named process in a nowait manner. By setting the
NOWAIT_TAG field to 1 in the input parameter structure, the PROCESS_LAUNCH_
procedure returns immediately without returning any value for the process handle or
the process descriptor in the output parameter structure. Instead, these values are
retrieved from system message -102 by calling the READUPDATEX procedure on the
$RECEIVE file:
.
.
PROG_NAME ':=' "REQFILE" -> @S^PTR;
@PARAM_LIST.PROGRAM_NAME := $XADR(PROG_NAME);
PARAM_LIST.PROGRAM_NAME_LEN := $DBL(@S^PTR '-' @PROG_NAME);
PARAM_LIST.NAME_OPTIONS := ZSYS^VAL^PCREATOPT^NAMEINCALL;
PROC_NAME ':=' "$REQ" -> @S^PTR;
@PARAM_LIST.PROCESS_NAME := $XADR(PROC_NAME);
PARAM_LIST.PROCESS_NAME_LEN := $DBL(@S^PTR '-' @PROC_NAME);
PARAM_LIST.NOWAIT_TAG ':=' 1D;
Structure of the PROCESS_LAUNCH or PROCESS_CREATE_ completion
message (-102):
sysmsg[0] = -102
sysmsg[1] FOR 2 = Nowait tag supplied to
process creation procedure
sysmsg[3] FOR 10 = Process handle of the new process
sysmsg[13] = Error
sysmsg[14] = Error detail
sysmsg[15] = Length of process descriptor for
new process
sysmsg[16] FOR 4 = Reserved for future use
sysmsg[20] FOR sysmsg[15] = Process descriptor of new process