Skip to content

Convert _ctypes extension module to multi-phase init #117142

Description

@neonene

Feature or enhancement

Proposal:

This issue is available to keep track of PRs, following the heap type conversion completed at #114314.

TODO:

  • [ ] Make free_list in malloc_closure.c per-module variables. rejected
  • Fix intentional memory leaks of StgInfo during a finalization: comment.
  • Enable Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED(DONE): comment.
    FUTURE?: Py_MOD_PER_INTERPRETER_GIL_SUPPORTED after a compatible PyGILState_Ensure() is introduced, see also the links below.

Links to documents:

Links to previous discussion of this feature:

Linked PRs

Activity

  1. added 2 commits that reference this issue on Mar 29, 2024
  2. added a commit that references this issue on Apr 10, 2024
  3. added 3 commits that reference this issue on Apr 17, 2024
  4. changed the title [-]Isolate the _ctypes extension module[/-] [+]Convert _ctypes extension module to multi-phase init[/+] on May 8, 2024
  5. neonene commented on May 8, 2024

    @neonene
    ContributorAuthor

    Could anyone add this open issue to the base issue's todo (port _ctypes branch) as a checked (finished) leaf? Thanks.

  6. 10 remaining items

  7. neonene commented on May 30, 2024

    @neonene
    ContributorAuthor

    In my understanding of #117181 (comment), the closure_fcn function in callbacks.c needs a new compatible PyGILState_Ensure() faimily like #59956 (comment) to enable Py_MOD_PER_INTERPRETER_GIL_SUPPORTED?

    Issue #55124 in 2011 has an experimantal patch: https://bugs.python.org/file20417/gilstateinterp.patch

  8. encukou commented on May 31, 2024

    @encukou
    Member

    Also mmap-based closure allocation needs a mutex, and I don't know how thread-safe the libffi API is. There might be other things.

  9. ericsnowcurrently commented on Jun 1, 2024

    @ericsnowcurrently
    Member

    FYI, PyGILState_Ensure() should work fine with subinterpreters, as of 3.12. It was necessary to fix that for per-interpreter GIL.

  10. ericsnowcurrently commented on Jun 1, 2024

    @ericsnowcurrently
    Member

    Regarding mmap and libffi, aren't those resolved for free-threading builds?

  11. added a commit that references this issue on Jun 3, 2024
  12. added a commit that references this issue on Jun 3, 2024
  13. added a commit that references this issue on Jun 3, 2024
  14. added a commit that references this issue on Jun 3, 2024
  15. added a commit that references this issue on Jun 5, 2024
  16. added a commit that references this issue on Jul 11, 2024
  17. added 3 commits that reference this issue on Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions