CRE Programmer's Guide
CRE Services
Common Run-Time Environment (CRE) Programmer’s Guide—528146-004
2-60
Language Support for Process Pairs
•
The program’s main routine must specify that it can run as a process pair. The
routine’s compiler sets this attribute in your program’s object file based on how you
set the NONSTOP compiler directive.
•
Your TACL environment must not specify PARAM NONSTOP OFF. You do not
need to specify PARAM NONSTOP ON because ON is the default value for the
NONSTOP parameter.
•
The program must invoke a statement in the language of your main routine that
initiates creation of a backup process.
•
If the program opens $RECEIVE, it must open it in TNS COBOL or FORTRAN, or
use routines written in TAL to call TNS CRE functions that manage $RECEIVE.
The program cannot open $RECEIVE from a C routine nor can it open $RECEIVE
by calling the FILE_OPEN_ system procedure if you want the TNS CRE to
manage backup processing for your program.
The CRE and the TNS COBOL and FORTRAN run-time libraries ensure that the
backup process receives not only the data that you checkpoint, but all of the CRE and
run-time library data that the backup process requires to take over as the primary
process if the current primary process cannot continue running.
Language Support for Process Pairs
To program using process pairs, you must use either the FORTRAN or the COBOL
language. To run as a process pair, your program must use COBOL or FORTRAN
constructs to start a backup process and ensure that the backup process has the
information required to become the primary process if the current primary process is
unable to continue executing.
For example, a routine written in COBOL starts a backup process by executing a
STARTBACKUP statement. The COBOL run-time library, with support from the CRE,
creates a backup process. The COBOL program itself does not participate further in
starting the backup process until the STARTBACKUP statement completes. Upon
completion, the COBOL run-time library sets a status code. Test the status code in
your COBOL routine to determine the result of the STARTBACKUP operation. Your
program uses checkpoint statements in the appropriate language (COBOL or
FORTRAN) at strategic points of its execution to send checkpoint information to its
backup process.
In mixed-language situations, write all the routines that control process pairs, such as
STARTBACKUP and CHECKPOINT, either in COBOL or FORTRAN. Do not control
process pairs from both COBOL and FORTRAN routines; however, a program that
runs with a backup process can contain both COBOL and FORTRAN routines.
Using C Routines in Process Pairs
Although the COBOL and FORTRAN run-time libraries support process pairs, the
C run-time library supports only active backup processes (and thus is incompatible