Ice.ThreadPool.*

5 min read

5 min read

6 min read

5 min read

5 min read

5 min read

5 min read

5 min read

5 min read

In language mappings that support thread pools, a communicator creates two thread pools:

  • the client thread pool is associated with outgoing connections: it reads Reply messages and executes AMI callbacks; it also reads and dispatches Request messages.
  • the server thread pool is associated with incoming connections: it reads and dispatches Request messages; it also reads Reply messages and executes AMI callbacks for bidir invocations on these connections.

This page describes configuration properties for the client and server thread pools. These thread pools are named Client and Server, respectively. In the property descriptions below, replace name with Client or Server.

The Ice.Admin object adapter uses the Server thread pool by default. Properties with the Ice.Admin.ThreadPool prefix configure a dedicated thread pool for this adapter.

Synopsis

Ice.ThreadPool.name.Serialize=num

Description

If num is a value greater than 0, the Client or Server thread pool serializes all messages from each connection. It is not necessary to enable this feature in a thread pool whose maximum size is 1 thread. When a thread pool dispatches requests implemented with AMD, it serializes the dispatching of requests from each connection, but it does not wait for a request to complete before it dispatches the next request.

In a multi-threaded pool, enabling serialization allows requests from different connections to be dispatched concurrently while preserving the order of messages on each connection. Note that serialization can have a significant impact on latency and throughput. If not defined, the default value is 0.

See also: Ice.Connection.MaxDispatches

Synopsis

Ice.ThreadPool.name.Size=num

Description

num is the number of threads that Ice starts in the Client or Server thread pool. When a thread becomes busy and no idle thread remains in the pool, Ice adds a thread, up to Ice.ThreadPool.name.SizeMax. Ice reaps idle threads as Ice.ThreadPool.name.ThreadIdleTime specifies, but always keeps at least 1 thread in the pool. The default value is 1.

To monitor the thread pool activities of the Ice runtime, set Ice.Trace.ThreadPool to 1.

Synopsis

Ice.ThreadPool.name.SizeMax=num

Description

num is the maximum number of threads for the Client or Server thread pool. Refer to the Ice.ThreadPool.name.Size property for more information on configuring the size of a thread pool.

The default value for SizeMax is the value of Size, meaning the thread pool can never grow larger than its initial size.

Setting SizeMax to -1 sets the maximum to the larger of Size and the number of processors available to the runtime.

To monitor the thread pool activities of the Ice runtime, set Ice.Trace.ThreadPool to 1.

Synopsis

Ice.ThreadPool.name.SizeWarn=num

Description

Whenever num threads are active in the Client or Server thread pool, a "low on threads" warning is printed. The default value is 0, which disables the warning.

To monitor the thread pool activities of the Ice runtime, set Ice.Trace.ThreadPool to 1.

Synopsis

Ice.ThreadPool.name.StackSize=num

Description

num is the stack size (in bytes) of threads in the Client or Server thread pool. The default value is 0, meaning the operating system's default is used.

Synopsis

Ice.ThreadPool.name.ThreadIdleTime=num

Description

Ice can automatically reap idle threads in the Client or Server thread pool to conserve resources. This property specifies the number of seconds a thread must be idle before it is reaped. If not specified, the default value is 60 seconds.

To disable the reaping of idle threads, set ThreadIdleTime to 0. In this situation, the thread pool is initialized with Ice.ThreadPool.name.Size active threads and may grow to contain Ice.ThreadPool.name.SizeMax active threads, but the size of the pool never decreases.

To monitor the thread pool activities of the Ice runtime, set Ice.Trace.ThreadPool to 1.

Synopsis

Ice.ThreadPool.name.ThreadPriority=value

Description

value specifies a thread priority for the threads in the Client or Server thread pool. Leaving this property unset causes the runtime to create threads with the default priority specified by Ice.ThreadPriority.

This property is unset by default.

value can be Lowest, BelowNormal, Normal, AboveNormal, or Highest.

The named values can also include the ThreadPriority. prefix, for example ThreadPriority.AboveNormal.

You can also override the default priority for a specific object adapter using adapter.ThreadPool.ThreadPriority.

Synopsis

Ice.ThreadPool.name.ThreadPriority=value

Description

value specifies a thread priority for the threads in the Client or Server thread pool. Leaving this property unset causes the runtime to create threads with the default priority specified by Ice.ThreadPriority.

This property is unset by default.

value can be MIN_PRIORITY, NORM_PRIORITY, MAX_PRIORITY, or an integer between 1 and 10.

The named values can also include the java.lang.Thread. prefix, for example java.lang.Thread.NORM_PRIORITY.

You can also override the default priority for a specific object adapter using adapter.ThreadPool.ThreadPriority.