mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
asyncio doc: list limitations to run subprocesses from different threads
This commit is contained in:
parent
15cc678d89
commit
399c59d7bd
2 changed files with 24 additions and 0 deletions
|
|
@ -297,6 +297,25 @@ Process
|
|||
``N`` (Unix only).
|
||||
|
||||
|
||||
.. _asyncio-subprocess-threads:
|
||||
|
||||
Subprocess and threads
|
||||
======================
|
||||
|
||||
asyncio supports running subprocesses from different threads, but there
|
||||
are limits:
|
||||
|
||||
* An event loop must run in the main thread
|
||||
* The child watcher must be instantiated in the main thread, before executing
|
||||
subprocesses from other threads. Call the :func:`get_child_watcher`
|
||||
function in the main thread to instantiate the child watcher.
|
||||
|
||||
.. seealso::
|
||||
|
||||
The :ref:`Concurrency and multithreading in asyncio
|
||||
<asyncio-multithreading>` section.
|
||||
|
||||
|
||||
Subprocess examples
|
||||
===================
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue