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

HP NonStop TMF Application Programmer’s Guide522419-004
2-1
2
Designing Single-Threaded
Processes
Application program modules are often designed as single-threaded processes.
Single-threaded requesters can only participate in one transaction at a time. Having
initiated one transaction, a single-threaded requester cannot initiate another
transaction until it has terminated the existing transaction.
Similarly, single-threaded servers can do work on behalf of only one transaction at a
time. Having accepted a work request for one transaction, a single-threaded server
cannot accept another work request until it has completed all of its work for the current
request.
This section contains the following topics:
Single-Threaded Requesters
Within the TMF programming environment, a requester is an application program
module that initiates and terminates a transaction. Although the requester usually
delegates work to one or more servers, and any of the servers can abort a transaction
for any reason at any time, the requester always remains the owner of the transaction
and is responsible for explicitly terminating it.
Applicable System and TMF Procedures
Single-threaded TMF requesters use the following system and TMF procedures:
ABORTTRANSACTION—aborts the current transaction
BEGINTRANSACTION—initiates a transaction and returns the value of its tag
FILE_CLOSE_—closes the TFILE or a server process
ENDTRANSACTION—terminates the current transaction
FILE_OPEN_—opens the TFILE or a server process
RESUMETRANSACTION (0)—sets the current transaction to the nil state
Topic Page
Single-Threaded Requesters
2-1
Single-Threaded Servers 2-11