Skip to content

Improve Interpreter Isolation #100227

Closed
Closed
@ericsnowcurrently

Description

@ericsnowcurrently

In CPython, we store (persistent) runtime data in several locations. (See https://github.com/ericsnowcurrently/multi-core-python/wiki/3-CPython's-Runtime#cpythons-run-time-data.)

The state of each interpreter (PyInterpreterState) encapsulates the data which is unique to that interpreter and isolated from other interpreters. That isolation is important for the proper operation of multiple interpreters in a process, and will be critical for a per-interpreter GIL, AKA PEP 684 (assuming it gets approved). There are still a number of gaps in isolation which we will address here.

The deficiencies may be categorized by the following:

  • shared runtime state (_PyRuntimeState) conceptually better suited to each interpreter
  • shared runtime state currently protected by the GIL
  • shared global variables that shouldn't be shared
  • shared global variables currently protected by the GIL

Linked PRs

Metadata

Metadata

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions