Skip to content

[subinterpreters][meta] Move fields from _PyRuntimeState to PyInterpreterState. #81058

Description

@ericsnowcurrently
BPO 36877
Nosy @vstinner, @phsilva, @ericsnowcurrently, @soltysh
Superseder
  • 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 = <Date 2020-05-15.01:31:54.956>
    created_at = <Date 2019-05-10.19:11:57.764>
    labels = ['expert-subinterpreters', '3.8']
    title = '[subinterpreters][meta] Move fields from _PyRuntimeState to PyInterpreterState.'
    updated_at = <Date 2020-05-15.01:31:54.955>
    user = 'https://github.com/ericsnowcurrently'

    bugs.python.org fields:

    activity = <Date 2020-05-15.01:31:54.955>
    actor = 'vstinner'
    assignee = 'eric.snow'
    closed = True
    closed_date = <Date 2020-05-15.01:31:54.956>
    closer = 'vstinner'
    components = ['Subinterpreters']
    creation = <Date 2019-05-10.19:11:57.764>
    creator = 'eric.snow'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36877
    keywords = []
    message_count = 4.0
    messages = ['342120', '342121', '342126', '368907']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'phsilva', 'eric.snow', 'maciej.szulik']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '40512'
    type = None
    url = 'https://bugs.python.org/issue36877'
    versions = ['Python 3.8']

    Activity

    1. ericsnowcurrently commented on May 10, 2019

      @ericsnowcurrently
      MemberAuthor

      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.

    2. ericsnowcurrently commented on May 10, 2019

      @ericsnowcurrently
      MemberAuthor

      FYI, I've already started some of this work:

      Other bits I'm planning on:

      • the rest of the global "ceval" state
      • the memory allocators
      • the GIL

      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).

    3. ericsnowcurrently commented on May 10, 2019

      @ericsnowcurrently
      MemberAuthor

      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.

    4. changed the title [-][meta] Move fields from _PyRuntimeState to PyInterpreterState.[/-] [+][subinterpreters][meta] Move fields from _PyRuntimeState to PyInterpreterState.[/+] on May 15, 2020
    5. vstinner commented on May 15, 2020

      @vstinner
      Member

      I mark this issue as a duplicate of bpo-40512.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions