Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 11
Updating State Information
3. A new backup process is created within the same CPU and with the same
PIN as the old primary process.
4. Before being notified of the change, a client process sends a message to
what it thinks is the primary server process, but what is actually the new
backup process.
The backup process checks the source of incoming messages so that it can
send an appropriate reply in such cases. The backup then continues
executing the message-processing loop.
Initialization and Application Processing Phases
The new primary process performs initialization and application processing activities
that are essentially the same as for the original primary process:
1. Creates and starts a new backup process. The new backup process is then ready
to take over if the primary process fails. The new primary process repeats the
initialization steps described earlier under Primary Process Organization.
2. Resumes application processing at the point in execution indicated by the most
recent state information. The new primary process sends state information to the
new backup process and monitors the backup process and CPU as described
above under Primary Process Organization.
Updating State Information
An important step in creating an active backup program is to develop a strategy for
updating state information. State information provides the backup process with the
data it needs to take over execution if the primary process fails. The information must
be correct and consistent so that the backup process can continue processing without
errors.
Updating state information involves saving information at a given logical point in
processing and passing it to the backup process so that the backup process can take
over execution at that point rather than starting at the beginning of execution. The
particular information determines where execution will resume in the backup process,
as illustrated in Figure 27-2. Note that for each update point in the primary process
there is a corresponding continuation point in the backup process. (Note that
Figure 27-2 is conceptual and does not use actual C language statements.)
Note. The new backup process can be started in the same CPU as the original primary
process or in a different CPU. The choice of which CPU to use is application-dependent.