mbox series

[RFC,0/6] Fix some fallouts with Python free-threading enabled

Message ID 20260326153210.2245962-1-zboszor@gmail.com
Headers show
Series Fix some fallouts with Python free-threading enabled | expand

Message

Böszörményi Zoltán March 26, 2026, 3:25 p.m. UTC
This is supplementary to the series entitled "Enable Python free-threading"
sent to the openembedded-core mailing list.

Quoting parts of the cover letter from there:

===========================================================================
See https://docs.python.org/3/howto/free-threading-python.html
Quote:

Python support for free threading

Starting with the 3.13 release, CPython has support for a build of
Python called free threading where the global interpreter lock
(GIL) is disabled. Free-threaded execution allows for full
utilization of the available processing power by running threads
in parallel on available CPU cores. While not all software will
benefit from this automatically, programs designed with threading
in mind will run faster on multi-core hardware.

Some third-party packages, in particular ones with an extension
module, may not be ready for use in a free-threaded build, and
will re-enable the GIL.

...

Compatibility is poor for a lot of modules, that clearly spell this out
in their pyproject.toml or PKG-INFO:

     "Programming Language :: Python :: Free Threading :: 1 - Unstable"

or something not quite production level support.
It's still experimental for 3rd party modules, despite being officially
supported for the interpreter and built-in modules in 3.14.
===========================================================================

That being said, a lot of python modules included in meta-openembedded
do build and use the correct site-packages path after applying the two
series, i.e. the module is installed into ${libdir}/python3.14t/site-packages

The usual warnings apply: DO NOT TRY THIS AT HOME.
If it breaks, you need to keep both pieces.