Skip to content

Conversation

@ngoldbaum
Copy link
Member

@ngoldbaum ngoldbaum commented Jul 22, 2024

PyMutex is available in the public C API starting in 3.13.0b3 which our CI should be running.

My understanding is that PyMutex is faster than PyThread_type_lock in all cases and that it should be used whenever it's available instead of PyThread_type_lock.

There's one usage inside a Py_GIL_DISABLED block. We now fail to compile on 3.13.0b2 and older if we don't want to keep the PyThread_type_lock code.

@ngoldbaum ngoldbaum added 03 - Maintenance component: numpy.strings String dtypes and functions 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) labels Jul 22, 2024
@mattip
Copy link
Member

mattip commented Jul 23, 2024

I could probably just fail to compile on 3.13.0b2 and older if we don't want to keep the PyThread_type_lock code.

I think that would be nice. Anyone using the beta releases does so at their own peril.

@ngoldbaum
Copy link
Member Author

I think that would be nice.

Done

@mattip mattip merged commit 872cb66 into numpy:main Jul 24, 2024
@mattip
Copy link
Member

mattip commented Jul 24, 2024

Thanks @ngoldbaum

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

Labels

03 - Maintenance 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) component: numpy.strings String dtypes and functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants