diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-05-08 19:15:09 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 19:15:09 (GMT) |
commit | 5c9ee498c6f4b75e0e020f17b6860309c3b7e11e (patch) | |
tree | 156aabe859f9c87bbad1bb7bfcc72e6169173d92 /Python/pystate.c | |
parent | 942482c8e660765f68098eae347d84b93e37661a (diff) | |
download | cpython-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.c | 4 |
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); |