CRE Programmer's Guide

CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide528146-004
2-59
Type Suffixes
occurred. The RTL_ version does not save the errno field nor does it save the
number of the error that occurred.
Type Suffixes
Many standard functions are represented by multiple versions, depending on the types
of the function’s parameters and the result returned by the function. For example, you
can invoke either RTL_Sin_Real32_ (which accepts a 32-bit REAL value and returns a
32-bit REAL result) or RTL_Sin_Real64_ (which accepts a 64-bit REAL value and
returns a 64-bit REAL result). The suffix corresponds to the types of the operands and
the results returned by the function. Use the function that corresponds to the data type
of your data.
Using Process Pairs
Both the TNS CRE and the native CRE support process pairs for fault-tolerant
programming. A process pair is a logical process that runs as two physical processes,
each in a separate processor. One of these processes is the primary process and the
other is the backup process. If the primary process becomes unavailable, the backup
process takes over and continues running.
In the Guardian environment, the CRE performs the tasks described in this subsection.
The OSS environment, however, does not support process pairs.
The primary process performs all of the computations specified by your program and
the run-time functions that your program invokes. While the primary process
successfully runs, the backup process does not execute any of your program’s
instructions. It merely stores state information passed to it by the primary process so
that if the primary process fails, the backup process has the information it needs to
become the primary process.
In addition to executing your program’s instructions, the primary process also:
Creates the backup process.
Sends information at strategic points of its execution—called checkpoints—to the
backup process so that if the primary process becomes unavailable (for example,
its processor fails, or a logic error in your program causes the primary process to
fail), the backup process can take over processing and assume the role of the
primary process.
Monitors $RECEIVE for messages from the backup process that report the status
of previously sent checkpoint messages.
Starts a new backup process if the backup process becomes unavailable.
Requirements for Using Process Pairs
The CRE runs your program as a process pair only if your program meets the following
requirements: