Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
854d0a4b
Commit
854d0a4b
authored
Aug 02, 2019
by
Joannah Nanjekye
Committed by
Eric Snow
Aug 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36487: Make C-API docs clear about what the main interpreter is. (gh-12666)
parent
bf8162c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
Doc/c-api/init.rst
Doc/c-api/init.rst
+12
-4
Misc/NEWS.d/next/Documentation/2019-04-02-19-23-00.bpo-36487.Jg6-MG.rst
...xt/Documentation/2019-04-02-19-23-00.bpo-36487.Jg6-MG.rst
+1
-0
No files found.
Doc/c-api/init.rst
View file @
854d0a4b
...
...
@@ -1141,10 +1141,18 @@ Sub-interpreter support
While in most uses, you will only embed a single Python interpreter, there
are cases where you need to create several independent interpreters in the
same process and perhaps even in the same thread. Sub-interpreters allow
you to do that. You can switch between sub-interpreters using the
:c:func:`PyThreadState_Swap` function. You can create and destroy them
using the following functions:
same process and perhaps even in the same thread. Sub-interpreters allow
you to do that.
The "main" interpreter is the first one created when the runtime initializes.
It is usually the only Python interpreter in a process. Unlike sub-interpreters,
the main interpreter has unique process-global responsibilities like signal
handling. It is also responsible for execution during runtime initialization and
is usually the active interpreter during runtime finalization. The
:c:func:`PyInterpreterState_Main` funtion returns a pointer to its state.
You can switch between sub-interpreters using the :c:func:`PyThreadState_Swap`
function. You can create and destroy them using the following functions:
.. c:function:: PyThreadState* Py_NewInterpreter()
...
...
Misc/NEWS.d/next/Documentation/2019-04-02-19-23-00.bpo-36487.Jg6-MG.rst
0 → 100755
View file @
854d0a4b
Make C-API docs clear about what the "main" interpreter is.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment