summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-05-08 19:15:09 (GMT)
committerGitHub <noreply@github.com>2023-05-08 19:15:09 (GMT)
commit5c9ee498c6f4b75e0e020f17b6860309c3b7e11e (patch)
tree156aabe859f9c87bbad1bb7bfcc72e6169173d92 /Python/pystate.c
parent942482c8e660765f68098eae347d84b93e37661a (diff)
downloadcpython-5c9ee498c6f4b75e0e020f17b6860309c3b7e11e.zip
cpython-5c9ee498c6f4b75e0e020f17b6860309c3b7e11e.tar.gz
cpython-5c9ee498c6f4b75e0e020f17b6860309c3b7e11e.tar.bz2
gh-99113: A Per-Interpreter GIL! (gh-104210)
This is the culmination of PEP 684 (and of my 8-year long multi-core Python project)! Each subinterpreter may now be created with its own GIL (via Py_NewInterpreterFromConfig()). If not so configured then the interpreter will share with the main interpreter--the status quo since subinterpreters were added decades ago. The main interpreter always has its own GIL and subinterpreters from Py_NewInterpreter() will always share with the main interpreter.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index f149343..26debf1 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -425,8 +425,6 @@ init_runtime(_PyRuntimeState *runtime,
runtime->open_code_userdata = open_code_userdata;
runtime->audit_hook_head = audit_hook_head;
- _PyEval_InitRuntimeState(&runtime->ceval);
-
PyPreConfig_InitPythonConfig(&runtime->preconfig);
PyThread_type_lock *lockptrs[NUMLOCKS] = {
@@ -682,7 +680,7 @@ init_interpreter(PyInterpreterState *interp,
memcpy(&interp->obmalloc.pools.used, temp, sizeof(temp));
}
- _PyEval_InitState(&interp->ceval, pending_lock);
+ _PyEval_InitState(interp, pending_lock);
_PyGC_InitState(&interp->gc);
PyConfig_InitPythonConfig(&interp->config);
_PyType_InitCache(interp);