What asyncio.gather Actually Does
Select all that apply. Which statements about asyncio.gather(...) are true?
- It runs all of its coroutines on a single thread, and the event loop only switches between them at await points inside each coroutine.
- It runs each coroutine in a separate OS thread, so CPU-bound coroutines passed to it get true parallel execution across cores.
- The list of results it returns preserves the order the coroutines were passed in, not the order in which they actually finished.
- If none of the coroutines ever reach an await expression, gather still overlaps their execution, running a few lines of each in turn.
Sign in to answer questions and track your progress
Sign In