projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e7cc03
)
asyncio doc: mention that asyncio is not thread-safe
author
Victor Stinner
<victor.stinner@gmail.com>
Fri, 7 Feb 2014 18:03:05 +0000
(19:03 +0100)
committer
Victor Stinner
<victor.stinner@gmail.com>
Fri, 7 Feb 2014 18:03:05 +0000
(19:03 +0100)
Doc/library/asyncio-dev.rst
patch
|
blob
|
history
diff --git
a/Doc/library/asyncio-dev.rst
b/Doc/library/asyncio-dev.rst
index 686e49605315ac59784859115cfe74a86bb4811b..aab925b1e53560c7b748508887c5d27ea4c1e5a6 100644
(file)
--- a/
Doc/library/asyncio-dev.rst
+++ b/
Doc/library/asyncio-dev.rst
@@
-23,6
+23,12
@@
schedule a coroutine from a different thread::
loop.call_soon_threadsafe(asyncio.async, coro_func())
+Most asyncio objects are not thread safe. You should only worry if you access
+objects outside the event loop. For example, to cancel a future, don't call
+directly its :meth:`Future.cancel` method, but::
+
+ loop.call_soon_threadsafe(fut.cancel)
+
To handle signals and to execute subprocesses, the event loop must be run in
the main thread.