[Python-checkins] cpython (3.4): asyncio doc: list limitations to run subprocesses from different threads

victor.stinner python-checkins at python.org
Fri Jan 9 01:32:40 CET 2015


https://hg.python.org/cpython/rev/a04d87fbff4e
changeset:   94083:a04d87fbff4e
branch:      3.4
parent:      94080:756d09136a2c
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Fri Jan 09 01:32:02 2015 +0100
summary:
  asyncio doc: list limitations to run subprocesses from different threads

files:
  Doc/library/asyncio-dev.rst        |   5 ++++
  Doc/library/asyncio-subprocess.rst |  19 ++++++++++++++++++
  2 files changed, 24 insertions(+), 0 deletions(-)


diff --git a/Doc/library/asyncio-dev.rst b/Doc/library/asyncio-dev.rst
--- a/Doc/library/asyncio-dev.rst
+++ b/Doc/library/asyncio-dev.rst
@@ -74,6 +74,11 @@
    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
--- a/Doc/library/asyncio-subprocess.rst
+++ b/Doc/library/asyncio-subprocess.rst
@@ -297,6 +297,25 @@
       ``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
 ===================
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list