---
title: "Thread Pool Design Considerations"
url: https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations
language: java
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Thread Pool Design Considerations

Programming language: Java. Other languages: [C++](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations/cpp.md), [C#](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations/csharp.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations/python.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations/swift.md).

By default, the client and server thread pools of a communicator have a single thread, so Ice dispatches one request at a time and processes one reply at a time. To let your application dispatch requests or process replies concurrently, you increase the maximum size of these thread pools. This page describes what each choice means for your application.

## Single-Threaded Pool

A thread pool with a maximum size of one thread behaves as follows:

- **The pool dispatches one request at a time**, which lets you avoid (or postpone) dealing with thread-safety issues in your servants.
- **The pool processes one reply at a time.** The AMI callbacks, which run on the same thread, also run one at a time.

## Multi-Threaded Pool

A thread pool with several threads dispatches requests and runs AMI callbacks concurrently, so your servants and callbacks must be thread-safe. The right maximum size depends on your workload: a compute-bound server gains nothing from more threads than cores, while a server whose dispatches block, on I/O for example, benefits from more threads than cores. Test with a realistic workload to find this size.

## See Also

- [Thread Pools](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pools/java.md)
- [Concurrent Proxy Invocations](https://docs.zeroc.com/ice/3.8/runtime/invocation/concurrent-proxy-invocations.md)
- [Nested Invocations](https://docs.zeroc.com/ice/3.8/runtime/threading-model/nested-invocations/java.md)
- [Connection Establishment](https://docs.zeroc.com/ice/3.8/runtime/connection-management/connection-establishment/java.md)
