Skip to content

About todos: GC and pymalloc #70

Description

@dexterhahaha

Half a year ago, I implemented a similar change to parallelize the sub-interpreters in the company's internal project. I noticed that there are related to-dos in the Dev documentation. My handling of these issues is:

  • Each sub-interpreter holds a garbage collection.
  • Each sub-interpreter holds a memory pool.
    I look forward to your changes being merged into 3.10, so that I don’t have to maintain my own custom changes based on version 3.8.

https://pythondev.readthedocs.io/subinterpreters.html

TODO list for per-interpreter GIL

Search for Subinterpreters issues at bugs.python.org.

Meta issue: per-interpreter GIL.

Effects of the EXPERIMENTAL_ISOLATED_SUBINTERPRETERS macro:

Good things!
Per-interpreter GIL!!!
Use a TSS to get the current Python thread state (‘tstate’)
_xxsubinterpreters.run_string() releases the GIL to run a subinterprer
Bad things :-( (mostly workarounds waiting for a real fix)
Disable pymalloc in preconfig.c: force malloc (or malloc_debug) allocator.
Don’t run GC collections in subinterpreters (see gc_collect_main).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions