liveBook · Manning

Thread pool

Also called ThreadPoolExecutor, worker pool

A thread pool is a managed collection of reusable worker threads that execute submitted tasks, typically avoiding the creation of a new thread for each task.

How 13 Manning books explain it

Python Concurrency with asyncio

A thread pool executor is an execution service that runs submitted callables using a reusable pool of worker threads.

How it is used
Runs blocking I/O alongside asyncio tasks without locking the event loop.
How deep it goes
Explains worker pools, sizing, queue submission, mapping, and asyncio integration, while deferring broader thread-safety details.
Examples
Demonstrates 1,000 requests with requests, asyncio gathering, and password hashing with hashlib and scrypt.
What you can do after
Apply it via concurrent.futures and asyncio to run blocking functions concurrently and collect their results.

Read how Python Concurrency with asyncio explains thread pool →

C++ Concurrency in Action, Second Edition

A thread pool is a managed collection of reusable threads that execute submitted tasks.

How it is used
Uses a bounded group of reusable workers to execute queued tasks without creating a thread for every task.
How deep it goes
Works through a minimal C++ implementation and its shutdown behavior, while identifying missing completion and return-value support.
Examples
Uses a simple C++ pool listing and parallel quicksort's stack of pending chunks.
What you can do after
Build it from scratch as a basic queued-worker pool, while recognizing its completion and contention limitations.

Read how C++ Concurrency in Action, Second Edition explains thread pool →

Functional Programming in Scala, Second Edition

A thread pool is a managed set of reusable worker threads that execute submitted tasks, optionally with a fixed maximum size.

How it is used
Diagnoses how bounded ExecutorService resources interact with fork and blocking waits in parallel computations.
How deep it goes
Explains single-thread deadlock step by step and generalizes it to any fixed-size pool, without presenting a repair.
Examples
Uses a one-worker Executors.newFixedThreadPool example and the nested pattern fork(fork(fork(x))).
What you can do after
Diagnose/debug with fixed-size thread pools by tracing submitted tasks, blocked Futures, and available workers.

Read how Functional Programming in Scala, Second Edition explains thread pool →

Functional Design and Architecture: Examples in Haskell

A thread pool is a managed collection of reusable worker threads whose size limits concurrent thread execution.

How it is used
Limits concurrent process creation in a layered application framework to control resource use.
How deep it goes
Develops restricted process operations and synchronized count bookkeeping, while identifying unresolved result-waiting and mutable-limit hazards.
Examples
Uses parallel meteor collection to illustrate rejected starts and result tokens, and a runtime with a four-process limit.
What you can do after
Evaluate bounded process-starting designs and their blocking, result-handling, and limit-change trade-offs.

Read how Functional Design and Architecture: Examples in Haskell explains thread pool →

Grokking Concurrency

A thread pool is a concurrency pattern that maintains a collection of reusable worker threads and assigns submitted tasks to available threads.

How it is used
Uses reusable workers to execute submitted tasks without requiring the main thread to create a thread for each task.
How deep it goes
Explains worker reuse, task queues, exception handling, scheduling, and pool sizing, with a Python worker implementation.
Examples
Illustrates workers with a Python task queue and combines a thread pool with an asynchronous pizza server.
What you can do after
Build a basic worker loop from scratch using Python threads and a task queue.

Read how Grokking Concurrency explains thread pool →

Starting Data Analytics with Generative AI and Python

ThreadPoolExecutor is a Python concurrency component that manages a pool of worker threads for executing callable tasks.

How it is used
Parallelizes repeated bootstrap calculations across worker threads when evaluating multicore execution.
How deep it goes
Demonstrates worker mapping and performance consequences, but stops short of a general concurrency treatment.
Examples
Uses parallel bootstrap confidence intervals with four threads and compares execution time against optimized and GPU-based implementations.
What you can do after
Apply it via Python's concurrent.futures library to distribute repeated callable tasks and inspect whether parallel execution improves performance.

Read how Starting Data Analytics with Generative AI and Python explains thread pool →

100 Go Mistakes and How to Avoid Them

A worker pool is a concurrency pattern that runs a fixed number of worker goroutines to process shared work or communicate through a common channel.

How it is used
Uses worker pooling to illustrate how workload type affects concurrency decisions.
How deep it goes
Works through a shared-channel pool with atomic aggregation and shutdown, then discusses buffer-sizing tradeoffs.
Examples
Demonstrates reading 1,024-byte chunks, processing tasks with ten goroutines, and atomically summing results.
What you can do after
Evaluate worker-pool and channel-buffer sizing against workload type and contention.

Read how 100 Go Mistakes and How to Avoid Them explains thread pool →

.NET in Action, Second Edition

A thread pool is a managed collection of reusable worker threads that execute queued work items.

How it is used
Explains how queued tasks get workers during an asynchronous HTTP search.
How deep it goes
Describes task queuing and worker assignment, but does not explain thread-pool configuration or scheduling internals.
Examples
Uses a search across more than 2,600 comics to illustrate queued tasks and bounded HTTP connections.
What you can do after
Evaluate/understand why creating many asynchronous search tasks need not exhaust threads or network sockets.

Read how .NET in Action, Second Edition explains thread pool →

Spring Microservices in Action

A thread pool is a managed set of reusable threads that executes submitted tasks.

How it is used
Contains remote-call workloads so one slow or busy service is less likely to exhaust threads serving other work.
How deep it goes
Explains shared-pool exhaustion and shows per-call pool, thread-count, and queue configuration, without detailing thread internals.
Examples
Uses a licensing lookup and a hello-service call to illustrate separate Hystrix-managed pools.
What you can do after
Configure separate Hystrix pools and set their thread counts and request-queue limits.

Read how Spring Microservices in Action explains thread pool →

JavaScript in Depth

A managed collection of worker threads that execute operations concurrently on behalf of a runtime or library.

How it is used
Diagnoses unexpected asynchronous latency and prevents aggregate CPU measurements from misrepresenting event-loop capacity.
How deep it goes
Explains shared workers, queueing, diagnostic metrics, and misleading symptoms without detailing libuv’s scheduling implementation.
Examples
Uses DNS lookup latency, fs.stat timing, uvMetricsInfo output, and HTTPS cryptographic work as diagnostic examples.
What you can do after
Diagnose/debug with uvMetricsInfo, callback timing, DNS latency, and event-loop-versus-pool CPU interpretation.

Read how JavaScript in Depth explains thread pool →

Go in Action, Second Edition

A thread pool is a managed collection of reusable worker threads that execute submitted tasks.

How it is used
Controls parallelism while distributing queued, independent work such as feed ingestion, incoming requests, I/O operations, and background jobs.
How deep it goes
Implements workers, a buffered shared channel, configurable pool size, submission, application integration, and shutdown.
Examples
Uses feed URLs, a buffered queue, three workers, timed feed fetching, an App-owned pool, and explicit Stop shutdown.
What you can do after
Build it from scratch using Go goroutines, channels, configurable workers, context timeouts, and explicit channel closure.

Read how Go in Action, Second Edition explains thread pool →

Vibe Engineering

A thread pool is a managed collection of reusable worker threads that execute submitted tasks.

How it is used
Deploys worker threads for concurrent CPU-bound processing while requiring explicit monitoring and performance validation.
How deep it goes
Explains pool overhead, statelessness, monitoring, cleanup, and benchmarking, but does not develop thread scheduling internals.
Examples
Compares account lookup using parallel streams, a fixed executor, CompletableFuture-based chunks, and a JMH benchmark.
What you can do after
Evaluate concurrency with JMH or custom benchmarks and operate a managed executor with explicit cleanup and monitoring.

Read how Vibe Engineering explains thread pool →

Clojure: The Essential Reference

A thread pool is a set of reusable worker threads managed to execute multiple tasks without creating a new thread for each task.

How it is used
Coordinates agent and future work, with custom executors available for workload-specific dispatch.
How deep it goes
Defines shared and configurable execution pools, but stops short of explaining worker scheduling internals.
Examples
Demonstrates a work-stealing executor, send-via dispatch, and global agent executor replacement.
What you can do after
Operate/configure agent execution with send-via or custom Executors.

Read how Clojure: The Essential Reference explains thread pool →

Also covered in

What to know first

Related concepts

Questions about thread pool

What is thread pool?

A thread pool is a managed collection of reusable worker threads that execute submitted tasks, typically avoiding the creation of a new thread for each task.

Which Manning books explain thread pool?

Python Concurrency with asyncio, C++ Concurrency in Action, Second Edition, Functional Programming in Scala, Second Edition, Functional Design and Architecture: Examples in Haskell, Grokking Concurrency, Starting Data Analytics with Generative AI and Python, 100 Go Mistakes and How to Avoid Them, .NET in Action, Second Edition and 5 more.

What should I know before learning thread pool?

Manning books that teach thread pool usually introduce thread, concurrency, async/await and parallelism first.

What is thread pool also called?

Thread pool is also called ThreadPoolExecutor or worker pool.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.