diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-15 12:10:48 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-01-15 12:10:48 (GMT) |
commit | f1dfe735b5451a4ff844ecb56679b4ef57194eda (patch) | |
tree | 575e8616849885fa0af1a32174204a1aefde02da /Doc/c-api/init.rst | |
parent | 8b50b831b4513481adc5e6260899fbdba8965384 (diff) | |
download | cpython-f1dfe735b5451a4ff844ecb56679b4ef57194eda.zip cpython-f1dfe735b5451a4ff844ecb56679b4ef57194eda.tar.gz cpython-f1dfe735b5451a4ff844ecb56679b4ef57194eda.tar.bz2 |
Improve description of issues
Diffstat (limited to 'Doc/c-api/init.rst')
-rw-r--r-- | Doc/c-api/init.rst | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 0ec1141..13759d7 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -861,13 +861,16 @@ in one sub-interpreter into a namespace of another sub-interpreter; this should be done with great care to avoid sharing user-defined functions, methods, instances or classes between sub-interpreters, since import operations executed by such objects may affect the wrong (sub-)interpreter's dictionary of loaded -modules. (XXX This is a hard-to-fix bug that will be addressed in a future -release.) - -Also note that the use of this functionality is incompatible with extension -modules such as PyObjC and ctypes that use the :c:func:`PyGILState_\*` APIs (and -this is inherent in the way the :c:func:`PyGILState_\*` functions work). Simple -things may work, but confusing behavior will always be near. +modules. + +Also note that combining this functionality with :c:func:`PyGILState_\*` APIs +is delicate, become these APIs assume a bijection between Python thread states +and OS-level threads, an assumption broken by the presence of sub-interpreters. +It is highly recommended that you don't switch sub-interpreters between a pair +of matching :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` calls. +Furthermore, extensions (such as :mod:`ctypes`) using these APIs to allow calling +of Python code from non-Python created threads will probably be broken when using +sub-interpreters. Asynchronous Notifications |