Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use rewording for multiprocessing
Co-authored-by: C.A.M. Gerlach <[email protected]>
  • Loading branch information
slateny and CAM-Gerlach authored Oct 16, 2022
commit fd68a5ea4e9c53261c56002f2366a080f1fa7b30
8 changes: 4 additions & 4 deletions Doc/library/asyncio-eventloop.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1209,10 +1209,10 @@ Executing code in thread or process pools
if __name__ == '__main__':
asyncio.run(main())

Note that on Windows and macOS, the entry point guard may be necessary as the
example would otherwise cause a :exc:`RuntimeError`. For more details, see the
`Safe importing of main module
<https://docs.python.org/3/library/multiprocessing.html#the-spawn-and-forkserver-start-methods>`_.
Note that the entry point guard (``if __name__ == '__main__'``)
is required for option 3 due to the peculiarities of :mod:`multiprocessing`,
which is used by :class:`~concurrent.futures.ProcessPoolExecutor.
See :ref:`Safe importing of main module <multiprocessing-safe-main-import>`.

This method returns a :class:`asyncio.Future` object.

Expand Down