---
title: "Thread Pool Design Considerations"
url: https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations
language: swift
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: Swift. 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), [Java](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations/java.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pool-design-considerations/python.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 reads one request at a time.** The dispatches themselves run concurrently, each in its own task; [Ice.Connection.name.MaxDispatches](https://docs.zeroc.com/ice/3.8/property-reference/ice-connection-properties/swift.md#ice.connection.name.maxdispatches) limits the concurrent dispatches on a connection.
- **The pool processes one reply at a time.**

## Multi-Threaded Pool

Each dispatch runs in its own task, executed by Swift concurrency's global concurrent executor whatever the size of the Ice thread pool, so dispatches run concurrently and your servants must be safe for concurrent calls. A multi-threaded pool only reads requests and replies in parallel.

## See Also

- [Thread Pools](https://docs.zeroc.com/ice/3.8/runtime/threading-model/thread-pools/swift.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/swift.md)
- [Connection Establishment](https://docs.zeroc.com/ice/3.8/runtime/connection-management/connection-establishment/swift.md)
