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
It should be possible to use SWIG to build a Python C extension for use with the free-threaded build of CPython.
I'm working at Quansight Labs along with a small team to improve ecosystem support for free-threaded Python. We've put together some documentation that is a good place to start: https://py-free-threading.github.io.
One big wrinkle that might come up is that free-threaded 3.13 (and maybe 3.14) won't support the limited API, so free-threaded extensions must use the version-specific ABI.
When we added free-threading support in other wrapper tools like Cython, PyO3, and F2Py the job of adding free-threaded support was first to make sure generated wrapping code is thread-safe. Once that's done, there needs to be a way for the extension author to signal that they think the extension is thread-safe.
The text was updated successfully, but these errors were encountered:
Given SWIG generates bindings for hundreds of Python extensions, it makes sense for SWIG to be involved. Good to have a heads up of this initiative and we can do what we can to help. Just so that you know, the SWIG developers are struggling to keep up with patches and necessary improvements and if Quansight Labs can assist, as you do other Python open source projects, it would certainly help the wider Python ecosystem and free-threaded Python stability. The most beneficial thing would be to find an advanced C Python API expert who can join the SWIG developer community to manage patches/pull requests and make other improvements into the SWIG code base. I say this as the SWIG developers are volunteers, are very few and without a sponsored SWIG developer, we're never going to keep up. Feel free to contact me offline or discuss further here if you feel Quansight can help.
It should be possible to use SWIG to build a Python C extension for use with the free-threaded build of CPython.
I'm working at Quansight Labs along with a small team to improve ecosystem support for free-threaded Python. We've put together some documentation that is a good place to start: https://py-free-threading.github.io.
One big wrinkle that might come up is that free-threaded 3.13 (and maybe 3.14) won't support the limited API, so free-threaded extensions must use the version-specific ABI.
When we added free-threading support in other wrapper tools like Cython, PyO3, and F2Py the job of adding free-threaded support was first to make sure generated wrapping code is thread-safe. Once that's done, there needs to be a way for the extension author to signal that they think the extension is thread-safe.
The text was updated successfully, but these errors were encountered: