Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 46
Sending and Receiving Assign and Param
Messages
!------------------------------------------------------------
! Main procedure calls INIT to read and save the Startup
! message and open the IN and OUT files, creates a new
! process, then passes on its own Startup message to the new
! process.
!------------------------------------------------------------
PROC INITIAL MAIN;
BEGIN
! Read and save the Startup message and open the IN and OUT
! files:
CALL INIT;
END;
Sending and Receiving Assign and Param Messages
You can send any number of Assign messages and a Param message to your new
process. You can do this using the standard startup sequence protocol, thereby
enabling your new process to read the Assign and Param messages with the
INITIALIZER procedure. However, note again that you can send this information any
way that you like, so long as the recipient process is able to interpret the format.
To use the standard startup protocol, your program must create messages in exactly
the format of the Assign or Param messages and then send them to the new process
using the WRITE[X] procedure. The recipient process reads these messages by
calling INITIALIZER with the parameters set for reading Assign and Param messages.
The action of the new process is identical to that taken by a process reading Assign or
Param messages from the TACL process.
For details of the contents of the Assign and Param messages and for details of how to
read Assign and Param messages, refer to Section 8, Communicating With a TACL
Process.
Monitoring a Child Process
Once you have created a child process, you often need to make sure that the child
process continues to run. You can check whether the child process has stopped by
reading messages from the $RECEIVE file. The following messages indicate that a
child process might have stopped:
-2 (Processor down message)
-100 (Remote processor down message)
-101 (Process deletion message)
-110 (Loss of communication with node)