Skip to content

gh-145912: Add a table for choosing between forms of concurrency - #162888

Open
ngoldbaum wants to merge 1 commit into
python:mainfrom
ngoldbaum:concurrency-overview-table
Open

ngoldbaum wants to merge 1 commit into
python:mainfrom
ngoldbaum:concurrency-overview-table

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

The top-level concurrency page added in bac9a53 and untouched since 2012 says the choice of tool depends on the task and ends its intro with "Here's an overview:" with no overview besides the docs toctree for each form of concurrency.

This structure is confusing and doesn't help users to decide between different forms of concurrency.

This adds a table under that sentence with the tool to reach for first for each kind of work, with one column per build. Only CPU-bound Python code differs between the builds.

It also adds a sentence about asyncio.to_thread() for asyncio programs, and a short transition to the module list that notes asyncio is not listed on this page. asyncio has been listed under "Networking and Interprocess Communication" since 2013, when it was moved there together with select and selectors (5467da8). This was before async and await were added to the language, along with asyncio.run() and TaskGroup. Maybe it makes sense to move asyncio here once again? That said, moving it to this chapter would be a separate PR.

The multi-threading HOWTO in #162624 will link to this table. Once #162886 is merged I'll link the "CPU-bound" rows to the new glossary entries.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #36276934 | 📁 Comparing 1f4cdee against main (114f465)

  🔍 Preview build  

1 file changed
± library/concurrency.html

* - Waits on many network connections, or needs cancellation and timeouts
- :mod:`asyncio`
- :mod:`asyncio`
* - CPU-bound work in :term:`native code` that releases the

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to add the term links here as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants