Skip to content

Commit f97bfb6

Browse files
committed
clarify event loops when multi threading.
1 parent b189b94 commit f97bfb6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Doc/howto/a-conceptual-overview-of-asyncio.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,11 @@ Creating a task automatically schedules it for execution (by adding a
176176
callback to run it in the event loop's to-do list, that is, collection of jobs).
177177
The recommended way to create tasks is via :func:`asyncio.create_task`.
178178

179-
Since there's only one event loop (per thread; in thread-local storage),
180-
:mod:`!asyncio` takes care of associating the task with the event loop for
181-
you.
182-
As such, there's no need to specify the event loop.
179+
:mod:`!asyncio` automatically associates tasks with the event loop for you.
180+
In many applications there's only a single thread with the one event loop,
181+
but you can have multiple threads, each with their own event loop.
182+
Each event loop is stored in thread-local storage, making it easy for
183+
:mod:`!asyncio` to associate tasks with the relevant loop for each thread.
183184

184185
::
185186

0 commit comments

Comments
 (0)