TMF Application Programmer's Guide (G06.26+)

Designing Single-Threaded Processes
HP NonStop TMF Application Programmer’s Guide522419-005
2-7
Checkpointing Strategy
To open the TFILE, a single-threaded requester uses an FILE_OPEN_ call of the
following form (illustrated in TAL).
filename
is the name of a variable containing the logical device name of the TMF
Management Process (TMP). The name is always $TMP. You can obtain the
name programmatically by calling the GETTMPNAME procedure.
filenumber
is the name of a variable into which the FILE_OPEN_ system procedure returns a
unique value identifying this instance of the TFILE. You use filenumber in
CHECKPOINT calls to synchronize the content of the backup requester’s TFILE
with that of the primary requesters TFILE.
nowait-depth
is the name of a variable containing the FILE_OPEN_ nowait-depth parameter. For
a single-threaded requester, this parameter is either a 0 or a 1 (both specifying that
the requester can have only one transaction in existence at any given time). Zero
(0) indicates that ENDTRANSACTION calls are to be waited, while 1 specifies that
they are to be completed by an AWAITIO call (nowait).
A process can open the TFILE only once; attempts to open multiple instances of the
TFILE, or to open the TFILE after having called BEGINTRANSACTION, will fail with a
condition code of CCL and a file system error number 12 (file in use).
Placement of Checkpoints
If a primary requester process fails while a transaction is in progress, TMF
automatically aborts the transaction.
The processing of a transaction never transfers in midstream from the primary
requester to the backup: the backup requester, upon sensing a failure of the
associated primary process, either restarts the aborted transaction and performs it in
its entirety (if there was a transaction in progress at the time of the failure) or moves on
to the next transaction (if the failure occurred between transactions).
The primary process periodically issues calls to the CHECKPOINT system procedure.
Depending upon what parameters you supply in the CHECKPOINT call, the
CHECKPOINT procedure causes either or both of the following actions to occur:
TMF updates the backup requesters TFILE to synchronize its content with that of
the primary requester’s TFILE.
The file system passes data from the primary requester’s data stack and any
combination of up to 13 separate data blocks and file synchronization blocks to the
CALL FILE_OPEN_ ( filename:4 , filenumber , , ,
nowait-depth );