background image
Bionic Buffalo Tech Note #49: Thread Support in the 
gibraltar
 Object Request Broker
gibraltar
 procedures are not async signal safe
If an application requires fewer restrictions (for instance, if it must be cancel safe), then a different
ORB (such as 
egypt
 or 
taiwan
) should be used.
The 
gibraltar
 ORB is available at http://www.tatanka.com/prod/info/gibraltar.html
Threads and the 
CORBA_Environment
Each thread is associated with a unique copy of the 
CORBA_Environment
. State information used
by the ORB for a thread is associated with that thread's 
CORBA_Environmen
t. A thread acquires a
pointer to its 
CORBA_Environment
 by calling 
tbt_get_environment()
The first time a thread calls 
tbt_get_environment()
, a new environment will be created for that
thread. Subsequent calls to 
tbt_get_environment()
 will return the same environment, without
creating a new environment. 
A thread can destroy its environment by calling 
tbt_destroy_environment()
. This can be
done at any time except from within a servant method. Once the thread's environment is destroyed, the
ORB is oblivious to the thread, and it may be cancelled or suicide if necessary. A thread whose
environment is destroyed also may call 
tbt_get_environment()
, and a new environment will be
created for that thread.
Operation Invocation and Connection Management
In operation invocations by local (same process) clients, threads are handled as follows:
For local servants, the method is called in the same thread used to call the operation.
For remote (different process or different network node) servants, the calling thread
blocks within the ORB until the operation is completed or fails. (Each pending remote
operation involves a separate remote connection; simultaneous connections to the same
server are not multiplexed.)
When initialized, the 
gibraltar
 ORB creates a thread whose sole purpose is to accept incoming
connections. The total number of simultaneous connections is limited by a configurable value, which
determines the maximum number of remote clients which can be connected at the same time. A thread
is also established for each potential simultaneous connection. (These are the connection threads.)
Each connection might result in zero or more active requests. Another configurable value determines
the maximum number of simultaneous requests, and a task is created for each. (These are the remote
request threads
.) Finally, a task is created whose purpose is to manage request and operation timeouts.
Thus, in addition to the threads created by the application itself, the ORB creates
Page 2 of 4