summaryrefslogtreecommitdiffstats
path: root/Doc/library/asyncio-subprocess.rst
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-09 00:32:02 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-09 00:32:02 (GMT)
commit399c59d7bd5caeacfd98338d69400f83f15987db (patch)
treef343a824649412c6e840b639414b6ea4b2d061ca /Doc/library/asyncio-subprocess.rst
parent15cc678d8971f5ee1a7ea5e88bcd22413601f033 (diff)
downloadcpython-399c59d7bd5caeacfd98338d69400f83f15987db.zip
cpython-399c59d7bd5caeacfd98338d69400f83f15987db.tar.gz
cpython-399c59d7bd5caeacfd98338d69400f83f15987db.tar.bz2
asyncio doc: list limitations to run subprocesses from different threads
Diffstat (limited to 'Doc/library/asyncio-subprocess.rst')
-rw-r--r--Doc/library/asyncio-subprocess.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst
index 1cbfcf2..570107e 100644
--- a/Doc/library/asyncio-subprocess.rst
+++ b/Doc/library/asyncio-subprocess.rst
@@ -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
===================