Quoting Kumar Aditya

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

Python developers using free-threaded builds can now run multiple asyncio event loops across threads with linear scaling and no lock contention in the general case.

Read this as

Python is a popular programming language, and its asyncio tool runs tasks that wait on things like network requests. In Python 3.14, developer Kumar Aditya rewrote asyncio so it can safely use multiple threads at once, using data structures that avoid slow locking. This means programs using the version of Python that no longer relies on its single-thread restriction can scale smoothly as threads are added.

Python 3.14 makes asyncio thread-safe on the free-threaded build of CPython, the Python interpreter being freed from the Global Interpreter Lock. Kumar Aditya states that with multiple event loops running in parallel there is no lock contention and performance scales linearly with thread count. Teams running concurrent Python services on free-threaded Python gain scalable async performance; those on standard builds see no change.

Kumar Aditya implemented several changes in Python 3.14 to fix asyncio thread safety on the free-threaded CPython build. asyncio now uses lock-free data structures and per-thread state for efficient task management and execution across threads. In the general case of multiple parallel event loops there is no lock contention and performance scales linearly with the number of threads. Implementation details are documented in CPython's internal asyncio docs.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Python 3.14 asyncio CPython Gil-free threading

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading