Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 55
Program Declarations
MONITORCPUS, which is called by the backup process to monitor the primary
process CPU. The operating system sends the backup process a “processor
down” message if the monitored CPU fails.
PROCESS_GETINFO_, PROCESS_GETPAIRINFO_, and
PROCESSHANDLE_DECOMPOSE_, which are used to obtain information about
the primary and backup processes.
PROCESS_STOP_, which is called by the primary process to stop the backup
process if an end-of-file is encountered in the input file.
PROCESSHANDLE_COMPARE_, which is called by the backup process to
determine if a message it received was sent by the primary process.
READUPDATEX, which is called by the backup process to receive messages from
the primary process through $RECEIVE.
REPLYX, which is called by the backup process to reply to messages it receives.
WRITEX, which is called by the primary process to send messages to the backup
process.
Message Declarations
The program uses four message formats: two defined by the operating system and
two defined by the program.
CPU_DOWN is a system message that indicates that a monitored CPU is down.
This message is used to notify the backup process if the primary process CPU fails
so that the backup process can take over processing.
PROCESS_DELETION is a system message that indicates that a process has
terminated. This message is used to notify the backup process if the primary
process terminates so that the backup process can take over processing.
UPDATE_OPEN is an application-defined message that contains the open state
information for the input and output files.
UPDATE_MESSAGE is an application-defined message that contains the current
state information needed by the backup process to define a continuation point and
update its memory.
The message declaration portion of the program serves the following purposes:
Provides macros that define the message numbers. Note that the system
message numbers are negative and the application-defined message numbers are
positive.
Declares a structure for each of the four message formats. The first member of the
structure contains the message number, and the second member is a union with
one member per message format. The information contained in the system
messages is not used (only the message number is used), so the exact structure is
not defined.