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

Designing Multithreaded Processes
HP NonStop TMF Application Programmer’s Guide522419-004
3-10
Checkpointing Strategy
If the transaction requires another WRITEREAD call, control passes to the
ISSUEWRITEREADTOSERVER code.
Upon return from either the ABORTTRANSACTION or CHECKPOINTTFILEENTRY
code, the MAINLOOP code once again displays the application data form on the
particular terminal’s screen, issues a nowait READ for the terminal, and then continues
checking for further AWAITIO completions.
The BEGINTRANSACTION Code
When the MAINLOOP code detects operator input, control passes to the
BEGINTRANSACTION code. The major functions of the BEGINTRANSACTION code
are as follows:
1. Save, in local storage, all of the application data necessary to start the new
transaction.
2. Issue a BEGINTRANSACTION call to initiate the new transaction.
3. Add the transaction tag, returned by BEGINTRANSACTION, to a list of active
transactions in local storage.
4. Issue a CHECKPOINT call. This call passes the startup data for the new
transaction (saved in step #1) and the active transaction list (saved in step #2) to
the backup requester and then generates an entry for the transaction in the backup
requester’s TFILE.
5. Pass control to the ISSUE WRITEREAD TO SERVER code.
The ISSUEWRITEREADTOSERVER Code
The ISSUE WRITEREADTOSERVER code formats a work request, sends the work
request to the appropriate server process by issuing a nowait WRITEREAD call, and
then returns control to the MAINLOOP code.
The CHECKPOINTTFILEENTRY Code
When the MAINLOOP code detects a successful AWAITIO completion for a nowait
ENDTRANSACTION call, control passes to the CHECKPOINTTFILEENTRY code. The
major functions of the CHECKPOINTTFILEENTRY code are as follows:
1. Issue a RESUMETRANSACTION call, specifying the tag value returned by the
AWAITIO completion.
2. Issue a CHECKPOINT call (containing the filenumber of the TFILE in the
parameter list) to flush the entry for the committed transaction from the backup
requester’s TFILE.
3. Delete the transaction tag from the list of active transactions in local storage.
4. Return control to the MAINLOOP code.