diff --git a/Doc/library/asyncio-task.rst b/Doc/library/asyncio-task.rst index bc79927b985627..beb66fb37a0fd0 100644 --- a/Doc/library/asyncio-task.rst +++ b/Doc/library/asyncio-task.rst @@ -1097,10 +1097,15 @@ Running in threads .. note:: - Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used - to make IO-bound functions non-blocking. However, for extension modules - that release the GIL or alternative Python implementations that don't - have one, ``asyncio.to_thread()`` can also be used for CPU-bound functions. + ``asyncio.to_thread()`` lets the event loop keep running while *func* + runs in another thread. With the :term:`GIL` enabled, the two threads + take turns running Python code, so a CPU-bound function slows the event + loop down. The event loop is not slowed down while the function is in a + call that releases the GIL, which long-running calls into + :term:`native code` often do. With the GIL disabled on the + :term:`free-threaded build`, the two threads do not have to take turns, + and several CPU-bound functions can make progress in + :term:`parallel ` with the event loop. .. versionadded:: 3.9