Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Availability of PyMutex to implement locking for thread-safety #6

Closed
rgommers opened this issue Apr 10, 2024 · 4 comments
Closed

Availability of PyMutex to implement locking for thread-safety #6

rgommers opened this issue Apr 10, 2024 · 4 comments

Comments

@rgommers
Copy link
Member

Relevant discussions for making PyMutex public in CPython for 3.13:

The second link notes some current alternatives, like PyThreadType_lock or platform-specific locks.

@ngoldbaum
Copy link
Collaborator

ngoldbaum commented Jun 7, 2024

The C API working group decided to expose PyMutex in the C API capi-workgroup/decisions#22 (comment). We’re after the code freeze so it will take a special decision from the release manager for it to be included in 3.13 but it will definitely be in 3.14.

@colesbury
Copy link
Contributor

PyMutex, PyMutex_Lock(), and PyMutex_Unlock() are now public in 3.13 (will be available in beta 3).

@colesbury
Copy link
Contributor

Also the critical section API (i.e., Py_BEGIN_CRITICAL_SECTION() is now available publicly)

@rgommers
Copy link
Member Author

This is all done and documented in https://py-free-threading.github.io/porting/ now, so let's close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants