You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing lz4 in a free-threaded Python re-enables the GIL with the following warning.
$ python
Python 3.13.0 experimental free-threading build (main, Oct 19 2024, 12:34:19) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lz4
<frozen importlib._bootstrap>:488: RuntimeWarning: The global interpreter lock (GIL) has been enabled to load module 'lz4._version', which has not declared that it can run safely without the GIL. To override this behavior and keep the GIL disabled (at your own risk), run with PYTHON_GIL=0 or -Xgil=0.
The text was updated successfully, but these errors were encountered:
Free-threading support would be great. I had a look at what it would take. The README says: "The bindings drop the GIL when calling in to the underlying LZ4 library, and is thread safe. An extensive test suite is included." and there aren't any open thread-safety issues - which looks like good news to me. The TODOs here should be something like:
Run the test suite with pytest-run-parallel to find potential issues, and fix them.
Run the test suite under ThreadSanitizer. Should be feasible, since there are no runtime dependencies aside from CPython itself.
Add cp313t-* to CI to build free-threading wheels.
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.
Our team at Quansight working on free-threading support in widely used open source projects is happy to help and work on this. Please do let us know if you'd prefer us to hold off for any reason.
Importing lz4 in a free-threaded Python re-enables the GIL with the following warning.
The text was updated successfully, but these errors were encountered: