Guardian Programmer's Guide

Table Of Contents
Fault-Tolerant Programming in C
Guardian Programmer’s Guide 421922-014
27 - 4
Programming Tasks
Programming Tasks
Once you have developed a strategy for updating state information and defined a
protocol for interprocess communication, you can begin coding your active backup
program. Compaq provides extensions to the C language that support active backup
programming. These language extensions are summarized later in this section under
C Extensions That Support Active Backup Programming. Following is a summary of
the programming tasks required or recommended for coding an active backup
program. Details for coding an active backup program are given later in this section
under Organizing an Active Backup Program.
To code a program to run in a fault-tolerant manner, you must:
Include statements to determine whether a process is the primary process or the
backup process.
Include statements to start the backup process and open it for interprocess
communication.
Provide a mechanism for sending state information to the backup process.
Provide a mechanism for the backup process to receive and save state information
from the primary process.
Provide a mechanism for the backup process to receive and process failure
messages from the primary process and from the operating system.
Provide a mechanism for the backup process to take over for the primary process
if the primary process or CPU should fail.
Provide a mechanism for the primary process to detect a failure of the backup
process.
Include statements for detecting and handling duplicate and old requests.
Include statements for reinitating pending I/Os and pending signal timeouts on
takeovers.
You use a combination of programming techniques, Guardian procedure calls, and
C-supplied functions to perform these tasks.