Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 36
Specifying Process Attributes and Resources
When you start a job, you assign the job number to the first process in the job when
you create the first process. The process that calls the PROCESS_LAUNCH_
procedure with a value specified in the JOBID field is known as the job ancestor (also
known as the godmother or GMOM). When a process that is part of a job starts or
terminates, the job ancestor receives a system message -112 (Job process creation) or
a system message -101 (Process deletion), respectively. The job ancestor can use
these messages to manage the job.
To assign a job ID to a process, you simply supply an integer value (other than 0 or -1)
in the JOBID field of the input parameter structure of the PROCESS_LAUNCH_
procedure. The following example assigns a job ID of 1:
.
.
PARAM_LIST.JOBID := 1;
ERROR := PROCESS_LAUNCH_( PARAM_LIST,
ERROR_DETAIL,
OUTPUT_LIST:$LEN(OUTPUT_LIST),
OUTPUT_LIST_LEN);
When a process within a job creates an additional process, the job ID is normally
passed on automatically to the additional process. For this to happen, the JOBID field
of the input parameter structure of PROCESS_LAUNCH_ must be set to -1. When the
additional process terminates, the system sends a death notification message to the
job ancestor as well as to the creator of the process.
A process that is part of a job can start a process that does not belong to the job by
issuing a PROCESS_LAUNCH_ procedure call with the JOBID field set to 0.
Termination of such a process does not result in a death notification message being
sent to the job ancestor, because the process is not a part of the job.
Propagating DEFINEs
Use the CREATE_OPTIONS and the DEFINES (and DEFINES_LEN) fields of the
input parameter structure to indicate which DEFINEs in the environment of the current
process should be propagated to the new process.
DEFINEs in the environment of the current process can be classified as:
DEFINEs in the context of the process
DEFINEs saved in a buffer by the process issuing the DEFINESAVE procedure call
Either or both of these groups of DEFINEs can be propagated to the new process. By
default, only DEFINEs in the context of the current process are propagated to the new
process; DEFINE mode in the new process is turned on or off as in the context of the
current process. To change either of these default settings, use bits 27, 28, 29, and 30
of the CREATE_OPTIONS field of the input parameter structure as described below.
Bits 27 and 28 of the CREATE_OPTIONS field specify which DEFINEs are
propagated.