Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

MakePy_BEGIN_CRITICAL_SECTION() andPy_END_CRITICAL_SECTION() public in the non-limited C API #119344

Closed
@colesbury

Description

@colesbury

Feature or enhancement

The critical section API is useful for making C API extensions thread-safe when the GIL is disabled. Compared to plain mutexes, the API makes it easier to avoid deadlocks, especially when interacting with the Python C API, where calls likePy_DECREF() may invoke destructors that themselves acquire locks.

A more detailed description and motivation is in PEP 703:https://peps.python.org/pep-0703/#python-critical-sections

The underlying implementation is hooked into Python'sPyThreadState management, so it would not be practical to implement this API outside of CPython.

C-API WG Issue

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp