← All notes

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

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

Origin

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

See also

Claims

Sources

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.

License: CC-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).

Cite this

Permanent ID: iil:note:yhpkhg46

iinventedlight. 2026. "concurrent.futures runs callables on thread or process pools behind one Executor API." iinventedlight Library, iil:note:yhpkhg46, version of 2026-11-18. https://iinventedlight.com/library/notes/python-concurrent-futures/. License: CC-BY-4.0.

@misc{iil_note_yhpkhg46,
  author = {{iinventedlight}},
  title = {{concurrent.futures runs callables on thread or process pools behind one Executor API}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-18},
  url = {https://iinventedlight.com/library/notes/python-concurrent-futures/},
  note = {Permanent ID iil:note:yhpkhg46. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-concurrent-futures.md.