You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[subinterpreters][meta] Move fields from _PyRuntimeState to PyInterpreterState. #81058
bpo-40512: [subinterpreters] Meta issue: per-interpreter GIL
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/ericsnowcurrently'closed_at=<Date2020-05-15.01:31:54.956>created_at=<Date2019-05-10.19:11:57.764>labels= ['expert-subinterpreters', '3.8']
title='[subinterpreters][meta] Move fields from _PyRuntimeState to PyInterpreterState.'updated_at=<Date2020-05-15.01:31:54.955>user='https://github.com/ericsnowcurrently'
We have quite a bit of global state the runtime that effectively breaks the isolation between interpreters. Some of it exists as "global" C variables (see bpo-36876) and the rest as fields on _PyRuntimeState. The offending state should be moved to PyInterpreterState.
Note that, to make the GIL per-interpreter, we can't have any remaining runtime state shared by interpreters (unless it is protected by its own locks).
In conjunction with bpo-36876, there are a bunch of currently ignored globals (in Tools/c-globals/ignored-globals.txt) that should actually be moved to per-interpreter runtime state. This mostly applies to any globals that point to one or more objects, since objects must not be shared by interpreters.
changed the title [-][meta] Move fields from _PyRuntimeState to PyInterpreterState.[/-][+][subinterpreters][meta] Move fields from _PyRuntimeState to PyInterpreterState.[/+]on May 15, 2020
Activity
ericsnowcurrently commentedon May 10, 2019
We have quite a bit of global state the runtime that effectively breaks the isolation between interpreters. Some of it exists as "global" C variables (see bpo-36876) and the rest as fields on _PyRuntimeState. The offending state should be moved to PyInterpreterState.
See Include/internal/pycore_pystate.h for the _PyRuntimeState and PyInterpreterState structs.
ericsnowcurrently commentedon May 10, 2019
FYI, I've already started some of this work:
Other bits I'm planning on:
Note that, to make the GIL per-interpreter, we can't have any remaining runtime state shared by interpreters (unless it is protected by its own locks).
ericsnowcurrently commentedon May 10, 2019
In conjunction with bpo-36876, there are a bunch of currently ignored globals (in Tools/c-globals/ignored-globals.txt) that should actually be moved to per-interpreter runtime state. This mostly applies to any globals that point to one or more objects, since objects must not be shared by interpreters.
[-][meta] Move fields from _PyRuntimeState to PyInterpreterState.[/-][+][subinterpreters][meta] Move fields from _PyRuntimeState to PyInterpreterState.[/+]vstinner commentedon May 15, 2020
I mark this issue as a duplicate of bpo-40512.