![]() |
![]() |
|
|
How Multithreading and Multicontexting Work in an ATMI Server
The events that occur in an ATMI server when a multithreaded and multicontexted application is active can be described in three phases:
Start-up Phase
What happens during the start-up phase depends on the value of the MINDISPATCHTHREADS and MAXDISPATCHTHREADS parameters in the configuration file.
Work Phase
In this phase, the following activities occur:
Server-dispatched Threads Are Used
In response to clients' requests for a service, the server dispatcher creates multiple threads (up to a configurable maximum) in one server that can be assigned to various client requests concurrently. A server cannot become a client by calling tpinit(3c).
Each dispatched thread is associated with a separate context. This feature is useful in both conversational and RPC servers. It is especially useful for conversational servers which otherwise sit idle, waiting for the client side of a conversation while other conversational connections are waiting for service.
This functionality is controlled by the following parameters in the SERVERS section of the UBBCONFIG(5) file and the TM_MIB(5).
UBBCONFIG Parameter |
MIB Parameter |
Default |
---|---|---|
MINDISPATCHTHREADS |
TA_MINDISPATCHTHREADS |
0 |
MAXDISPATCHTHREADS |
TA_MAXDISPATCHTHREADS |
1 |
THREADSTACKSIZE |
TA_THREADSTACKSIZE |
0 (representing the OS default) |
Application-created Threads Are Used
Using your operating system functions, you may create additional threads within an application server. Application-created threads may:
Some restrictions govern what you can do if you create threads in your application.
Bulletin Board Liaison Verifies Sanity of System Processes
The Bulletin Board Liaison (BBL) periodically checks servers. If a server is taking too long to execute a particular service request, the BBL kills that server. (If specified, the BBL then restarts the server.) If the BBL kills a multicontexted server, the other service calls that are currently being executed are also terminated as a result of the process being killed.
The BBL also sends a message to any process or thread that has been waiting longer than its timeout value to receive a message. The blocking message receive call then returns an error indicating a timeout.
System Keeps Statistics on Server Threads
For each server, the BEA Tuxedo system maintains statistics for the following information:
Userlog Maintains Thread-specific Information
For each thread in each application, userlog(3c) records the following identifying information:
process_ID.thread_ID.context_ID
Placeholders are printed in the thread_ID and context_ID fields of entries for non-threaded platforms and single-contexted applications.
The TM_MIB(5) supports this functionality in the TA_THREADID and TA_CONTEXTID fields in the T_ULOG class.
Completion Phase
When the application is shut down, tpsvrthrdone(3c) and tpsvrdone(3c) are called to perform any termination processing that is necessary, such as closing a resource manager.
See Also
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|