Skip to content

ENH: Free-Threading (No-GIL) Support for Python 3.13+ #749

Description

@HaoZeke

xref #670

I took a quick look, and I'm not wholly sure on what parts of the locking, possibly synchronizing access to the c-bloc library. Worst case scenario, maybe each of the codecs need to be checked for support.

The standard TODOs for adding free-threading support are in two phases, the first of which is a baseline consisting of the following tasks:

  • Run the test suite with pytest-run-parallel to find potential issues, and fix them.
  • Run the test suite under ThreadSanitizer. If possible, depends on how many dependencies there are and if they run under TSan.
  • Add cp313t-* to CI to build free-threading wheels.

The next phase is a bit more invasive, and it involves a single task:

For more details, please see the suggested plan of attack in the py-free-threading guide. The two phase approach is discussed in explosion/cymem#47 (comment) and gorakhargosh/watchdog#1105 (comment).

Note that this is the first time I've looked at this repo, so I might be
missing known issues or code that needs closer inspection. Any suggestions here
will be very useful. I'll start with the build without warning PR as also discussed in #670.

Let me know if I ought to hold off for any reason. (including if @tomwhite is working on it).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions