CORBA 2.6.1 Programmer's Guide for Java
With ORB_CTRL_MODEL, the POA initially creates a single thread to handle requests for objects in a server. When a new request arrives, the
POA either reuses an existing thread from the thread pool or spawns a new thread (When the thread pool is empty and the maximum number of
threads has not been reached) to handle the new request. For a new or reused thread to be activated, the thread processing the original request
must have become blocked or have explicitly released control of the processor. When the thread does not release control of the processor, the
POA thread cannot run and spawn or reuse a thread.
By using the ORB_CTRL_MODEL threading policy, servers can take advantage of multithreading without doing any explicit programming. In
certain situations, however, you might also find it desirable to make a server explicitly spawn new threads. Such threads can coexist with POA-
spawned threads. When doing explicit multithreading in server programs, remember the following points:
Do not make process-blocking calls from a thread. Such calls defeat the purpose of a multithreaded process because the whole process
is blocked for the duration of the call. The SQL/MP and SQL/MX products do not support threads; therefore, all SQL calls are process-
blocking calls.
Operations directed to distributed objects are thread-blocking; nowait file I/O operations are also thread-blocking. Such operations block
only the calling thread, rather than the whole process. A well-designed multithreaded program makes use of thread-blocking operations
but not process-blocking operations.
Multiple active requests for the same object can be dispatched within multiple threads at the same time. Therefore, you must code such
portions as thread-safe (reentrant) code, protecting the object from access by more than one thread at a time.
Chapter 7. Managing Transactions Chapter 9. Designing Advanced Applications