Object Adapter Thread Pools
2 min read
2 min read
2 min read
2 min read
2 min read
An object adapter uses a thread pool to accept connections and to read and dispatch the requests that arrive on them. By default, it uses the server thread pool of its communicator, which is sufficient for most applications. An object adapter with its own thread pool is useful in three situations:
- The object adapter hosts servants that are not thread-safe, and you want all the dispatches to these servants, from any connection, to run one at a time: a dedicated thread pool with
SizeandSizeMaxset to 1 does this. - The opposite: the communicator's server thread pool has a single thread, the default, and you want this object adapter to dispatch requests concurrently.
- You want to insulate this object adapter from the exhaustion of the communicator's server thread pool by the dispatches of other object adapters.
An object adapter creates its own thread pool when any adapter.ThreadPool.* property is set. These properties have the same meaning and defaults as the Ice.ThreadPool.* properties of the communicator's thread pools. For example, the properties shown below configure a thread pool for the object adapter named PrinterAdapter:
Properties
PrinterAdapter.ThreadPool.Size=3PrinterAdapter.ThreadPool.SizeMax=15PrinterAdapter.ThreadPool.SizeWarn=14