Skip navigation.

CORBA Programming Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


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

argc

The number of arguments provided to the application. Initially, this count is passed to the main function.

argv

The arguments provided to the application. Initially, these arguments are passed to the main function.

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

CORBA::Boolean

True if the initialization of the thread was successful.

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;
}

 

Skip navigation bar  Back to Top Previous Next