e-docs > Tuxedo > Administering a Tuxedo Application at Run Time > TP Framework |
Administering a Tuxedo Application at Run Time |
ServerBase::thread_initialize()
Synopsis
Performs any necessary application-specific initialization for a thread created using the BEA Tuxedo software. This method supports the development of a multithreaded server application.
C++ Binding
CORBA::Boolean thread_initialize(int argc, char** argv)
Arguments
Description
In managing the thread pool, the BEA Tuxedo software creates and releases threads using the operating system thread library services. Depending on application requirements, these threads might need to be initialized before they are used to process requests.
The thread_initialize callback method is invoked each time a thread is created, to initialize the thread. Note that the BEA Tuxedo software manages a number of system-owned threads that are used for dispatching requests; these system-owned threads are in addition to those threads in the thread pool. Under some circumstances the servant methods you implement are also executed in these system-owned threads; for this reason the BEA Tuxedo software invokes the thread_initialize method to initialize the system-owned threads.
The ServerBase class provides a default implementation of the thread_initialize method that opens the XA resource manager in the initialized thread.
Return Value
Example
CORBA::Boolean simple_per_request_server::thread_initialize(
int argc, char** argv)
{
TP::userlog("thread_initialize called in thread %ld",
(unsigned long)SIMPTHR_GETCURRENTTHREADID);
return CORBA_TRUE;
}