10.2.4.1.2 Client Threads Switch to an Existing Context
Many ATMI functions operate on a per-context basis. In such cases, the target context must be the current context. Although clients can join more than one context, at any time, in any thread, only one context can be the current context.
As task priorities shift within an application, requiring interactions with one Oracle Tuxedo domain rather than another, it is sometimes advantageous to reassign a thread from one context to another.
In such situations, one client threads calls tpgetctxt(3c)
and passes the handle that is returned (the value of which is the current context) to a second client thread. The second thread then associates itself with the current context by calling tpsetctxt(3c) and specifying the handle it received from tpgetctxt(3c) via the first thread.
Once the second thread is associated with the desired context, it is available to perform tasks executed by ATMI functions that operate on a per-context basis. For details, see Using Per-context Functions and Data Structures in a Multithreaded ATMI Client.
Parent topic: Start-up Phase