Skip to content

add asyncio guide for Free-Threaded Python#150456

Open
kumaraditya303 wants to merge 4 commits into
python:mainfrom
kumaraditya303:asyncio-threadsafety
Open

add asyncio guide for Free-Threaded Python#150456
kumaraditya303 wants to merge 4 commits into
python:mainfrom
kumaraditya303:asyncio-threadsafety

Conversation

@kumaraditya303
Copy link
Copy Markdown
Contributor

No description provided.

@read-the-docs-community
Copy link
Copy Markdown

read-the-docs-community Bot commented May 26, 2026

Documentation build overview

📚 cpython-previews | 🛠️ Build #32868007 | 📁 Comparing 825b4eb against main (629da5c)

  🔍 Preview build  

6 files changed · + 1 added · ± 5 modified

+ Added

± Modified

Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst Outdated
kumaraditya303 and others added 2 commits May 26, 2026 15:31
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@kumaraditya303 kumaraditya303 added needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels May 26, 2026
Comment thread Doc/library/asyncio-threading.rst Outdated
Comment thread Doc/library/asyncio-threading.rst
@bedevere-app
Copy link
Copy Markdown

bedevere-app Bot commented May 26, 2026

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

multi-threaded environment.

Combining asyncio with threads is most useful when you want to scale
I/O-bound work across multiple CPU cores by running an event loop per
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.

Maybe I don't know enough about asyncio: why would I/O-bound work need multiple cores in order to scale?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

One core may handle multiple requests concurrently but not in parallel, with multiple cores you can handle them in parallel.

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.

I guess you mean the computation required by the requests once the IO is complete? One core with asyncio can make progress on the IO itself in parallel. Or am I misunderstanding. I don't mean to pick at this too much, but I think this particular point can be a source of confusion, and it would be stellar to concisely explain it here.

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

Labels

awaiting changes docs Documentation in the Doc dir needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes skip issue skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

3 participants