Thread pool
A worker pool is a managed collection of workers that execute submitted or queued tasks, typically reusing workers to handle multiple tasks concurrently.
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
- Bounds concurrent domain processes by moving thread creation into an application-level runtime.
- How deep it goes
- Works through restricted languages, process APIs, blocking behavior, token flaws, and an MVar-based interpreter.
- Examples
- Uses an unbounded `forkIO` loop and parallel meteor retrieval with process tokens.
- What you can do after
- Build it from scratch with fixed limits, synchronized counts, blocking admission, and completion cleanup.
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 incoming tasks for the main thread without creating a thread for every task.
- How deep it goes
- Defines the pattern and shows a Python worker loop, while noting that scheduling and pool sizing can be complex.
- Examples
- Uses a Python queue-based worker, chunked password search, and an asynchronous pizza-order server.
- What you can do after
- Build it from scratch with Python threads and a task queue, or apply a thread pool alongside an event loop.
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 a fixed set of goroutines to process shared tasks while examining how workload type affects concurrency choices.
- How deep it goes
- Works through a Go implementation with a channel, wait group, and atomic counter; leaves the example’s read-loop details unfinished.
- Examples
- Contrasts sequential and pooled processing of 1,024-byte io.Reader chunks, with a ten-worker Go sketch.
- What you can do after
- Build it from scratch using goroutines, a shared channel, a wait group, and atomic result updates.
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 →
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 →
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 →
Related concepts
- std::functionuses · std::function is a C++ standard-library class template that stores and invokes callable objects compatible with a specified function signature.
- std::thread::hardware_concurrencyuses · A C++ standard library function that returns a hint about the number of hardware threads available for concurrent execution.
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.









