summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-01-09 00:32:25 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-01-09 00:32:25 (GMT)
commit25638d3109f6de1651fc8f39799b87d5347d59ad (patch)
treebc4502d536c4e91cec53926a53bcf1699e1ebbe3
parent53a6d74fbf3136652ad284f636ff9576f030007e (diff)
parent399c59d7bd5caeacfd98338d69400f83f15987db (diff)
downloadcpython-25638d3109f6de1651fc8f39799b87d5347d59ad.zip
cpython-25638d3109f6de1651fc8f39799b87d5347d59ad.tar.gz
cpython-25638d3109f6de1651fc8f39799b87d5347d59ad.tar.bz2
Merge 3.4 (asyncio doc)
-rw-r--r--Doc/library/asyncio-dev.rst5
-rw-r--r--Doc/library/asyncio-subprocess.rst19
2 files changed, 24 insertions, 0 deletions
diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst
index 63af06a..7083e60 100644
--- a/Doc/library/asyncio-dev.rst
+++ b/Doc/library/asyncio-dev.rst
@@ -74,6 +74,11 @@ the event loop.
The :ref:`Synchronization primitives <asyncio-sync>` section describes ways
to synchronize tasks.
+ The :ref:`Subprocess and threads <asyncio-subprocess-threads>` section lists
+ asyncio limitations to run subprocesses from different threads.
+
+
+
.. _asyncio-handle-blocking:
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
===================