C/C++ Programmer's Guide (G06.25+)
Using the C Run-Time Library
HP C/C++ Programmer’s Guide for NonStop Systems—429301-008
4-8
Active Backup Programming Functions
•
IEEE floating-point format is available only on NonStop servers with the underlying
hardware capacity, running a G07 or later version of the HP NonStop operating
system.
For more general information about IEEE floating-point format, see Compiling and
Linking Floating-Point Programs on page 16-4, and see the Guardian Programmer’s
Guide. For more information about using IEEE floating-point format (including the
exponent ranges and the number of bits of exponents and fractions), see the pragma
IEEE_FLOAT on page 13-45.
Table 4-2 shows the differences in precision between the two floating-point formats.
Active Backup Programming Functions
The term “fault tolerant” means that a single failure does not cause processing to stop.
The C run-time library enables you to write fault-tolerant programs using the active
backup programming model. Active backup programs are supported only in the
Guardian environment.
The active backup programming model is the only method to write fault-tolerant
programs in C. Use of the Guardian CHECKMONITOR procedure to perform “passive”
backup programming does not provide true fault tolerance in C programs.
In active backup programming, processes run in pairs: a primary process that performs
the tasks of the underlying application, and a backup process that is ready to take over
execution from the primary process if the primary process or processor fails. Active
backup programs have the following characteristics:
•
Active backup uses process pairs to achieve fault tolerance.
•
The primary process sends state information to the backup process. State
information is information about the run-time environment that is required for the
backup process to take over for the primary process.
•
The backup process receives state information from the primary process, detects a
failed primary process or CPU, and takes over execution.
An active backup program executes as a primary and backup process pair running the
same program file. The primary and backup processes perform interprocess
communication. The primary process sends critical data to the backup process. This
Table 4-2. Comparison of IEEE and Tandem Floating-Point Formats
Characteristic
IEEE
float
Tandem
float
IEEE
double
Tandem
double
Total bits in format 32 32 64 64
Bits of exponent 8 9 11 9
Bits of stored fraction 23 22 52 54
Nominal precision,
including hidden bit
24 23 53 55