---
source: https://iinventedlight.com/library/notes/python-concurrent-futures.md
title: "concurrent.futures runs callables on thread or process pools behind one Executor API"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "PSF-2.0 (Python docs (library)); Public-Domain (Python PEPs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python docs (library), concurrent.futures — Launching parallel tasks; Python PEPs, PEP 3148 – futures - execute computations asynchronously. PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Public-Domain (https://peps.python.org/pep-0001/). PEP text is placed in the public domain (some also CC0-1.0)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: concurrent.futures"
tags: [python, concurrent.futures, ThreadPoolExecutor, ProcessPoolExecutor, executor, future]
client: Librarian
sources:
  - id: S1
    title: "concurrent.futures — Launching parallel tasks"
    publisher: Python docs (library)
    url: https://docs.python.org/3/library/concurrent.futures.html
    accessed: 2026-11-18
    license: "PSF-2.0"
  - id: S2
    title: "PEP 3148 – futures - execute computations asynchronously"
    publisher: Python PEPs
    url: https://peps.python.org/pep-3148/
    accessed: 2026-11-18
    license: "Public-Domain"
---
# concurrent.futures runs callables on thread or process pools behind one Executor API
**Answer:** `ThreadPoolExecutor` uses a pool of threads and `ProcessPoolExecutor` uses a pool of processes to execute calls asynchronously. Both are Executor subclasses with `submit()` and `map()`.

## Example

```python
from concurrent.futures import ThreadPoolExecutor, as_completed
import shutil
with ThreadPoolExecutor(max_workers=4) as e:
    futs = [e.submit(shutil.copy, f"src{i}.txt", f"dest{i}.txt") for i in range(4)]
    for f in as_completed(futs):
        f.result()
```

## Facts

- `ThreadPoolExecutor` is an Executor subclass that uses a pool of threads to execute calls asynchronously.
- `ProcessPoolExecutor` uses a pool of processes. Its `max_workers` defaults to `os.process_cpu_count()` when None or not given.
- Using the executor as a context manager via the `with` statement will shutdown the Executor, as if `shutdown()` were called with wait set to True.
- `Executor.map` is like `map(fn, *iterables)`, but it collects the iterables immediately rather than lazily unless a `buffersize` is specified.
- Deadlocks can occur when a callable waits on the result of another Future, for example `future.result()` inside a single-worker pool.
- The `cancel_futures` parameter of `shutdown()` was added in 3.9.

## Origin

PEP 3148 proposed this package to facilitate the evaluation of callables using threads and processes; it shipped in Python 3.2.

## See also

- [python-asyncio-basics](https://iinventedlight.com/library/notes/python-asyncio-basics/)
- [python-functools](https://iinventedlight.com/library/notes/python-functools/)

## Claims

- id: C1
  claim: ThreadPoolExecutor uses a pool of threads.
  source: S1
  evidence: "ThreadPoolExecutor is an Executor subclass that uses a pool of threads to execute calls asynchronously."

- id: C2
  claim: ProcessPoolExecutor defaults to os.process_cpu_count() workers.
  source: S1
  evidence: "If max_workers is None or not given, it will default to os.process_cpu_count()"

- id: C3
  claim: Executor.map collects iterables immediately unless buffersize is set.
  source: S1
  evidence: "The iterables are collected immediately rather than lazily"

- id: C4
  claim: PEP 3148 designed a package for callables on threads and processes.
  source: S2
  evidence: "facilitates the evaluation of callables using threads and processes"

## Sources

- [S1] concurrent.futures — Launching parallel tasks. Python docs (library). https://docs.python.org/3/library/concurrent.futures.html . License: PSF-2.0. Accessed 2026-11-18.

- [S2] PEP 3148 – futures - execute computations asynchronously. Python PEPs. https://peps.python.org/pep-3148/ . License: Public-Domain. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python docs (library), concurrent.futures — Launching parallel tasks; Python PEPs, PEP 3148 – futures - execute computations asynchronously. PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Public-Domain (https://peps.python.org/pep-0001/). PEP text is placed in the public domain (some also CC0-1.0). Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
