-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
free-threading: Locking for internal data structures
This commit enables free-threaded extension builds on Python 3.13+, which involves the following changes: - nanobind must notify Python that an extension supports free-threading. - All internal data structures must be protected from concurrent modification. The approach taken varies with respect to the specific data structure, and a long comment in ``nb_internals.h`` explains the design decisions all of the changes. In general, the implementation avoids centralized locks as much as possible to improve scalability. - Adopting safe versions of certain operations where needed, e.g. ``PyList_GetItemRef()``. - Switching non-object allocation from ``PyObject_Allo()`` to ``PyMem_Alloc()``.
- Loading branch information
Showing
13 changed files
with
588 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.