Title: Support for free-threaded CPython (3.14t or newer) · Issue #503 · boostorg/python · GitHub
Open Graph Title: Support for free-threaded CPython (3.14t or newer) · Issue #503 · boostorg/python
X Title: Support for free-threaded CPython (3.14t or newer) · Issue #503 · boostorg/python
Description: This issue is intended to track the efforts of adding support for the free-threaded build for CPython (3.14t and potentially 3.13t). The Python free-threading guide contains some helpful advice on approaching this task. Based on what has...
Open Graph Description: This issue is intended to track the efforts of adding support for the free-threaded build for CPython (3.14t and potentially 3.13t). The Python free-threading guide contains some helpful advice on ...
X Description: This issue is intended to track the efforts of adding support for the free-threaded build for CPython (3.14t and potentially 3.13t). The Python free-threading guide contains some helpful advice on ...
Opengraph URL: https://github.com/boostorg/python/issues/503
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support for free-threaded CPython (3.14t or newer)","articleBody":"This issue is intended to track the efforts of adding support for the free-threaded build for CPython (3.14t and potentially 3.13t). The [Python free-threading guide](https://py-free-threading.github.io/porting/) contains some helpful advice on approaching this task. Based on what has been done for pybind11, I think the following steps make sense:\n\n- Add mechanism to set the `Py_MOD_GIL_NOT_USED`. I have a patch that does something similar to what pybind11 does: add a variadic macro with an optional flag so extensions can opt-in to free-threaded support\n- Replace borrow based APIs with strong reference ones (e.g. `PyDict_GetItemRef`)\n- Use a mutex to protect global state (e.g. the registry)\n- Fix references to `ob_refcnt`, don't use `Py_REFCNT()` as an l-value.\n- Modify tests so we can run them in parallel, run with the TSAN build to find races\n- Fixes to \"faber\" to work with new versions of Python. The most recent release of faber fixes most things, I believe.\n\nI have code that does most of this, I will create a PR. I'm still working on some crash bugs when running with 3.14t. If you run the Boost.Python tests with a single thread, they pass. So that's encouraging.\n\nRelated issues:\n- https://github.com/boostorg/python/issues/458\n\nRelated PRs:\n- https://github.com/boostorg/python/pull/504","author":{"url":"https://github.com/nascheme","@type":"Person","name":"nascheme"},"datePublished":"2025-10-29T18:22:07.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/503/python/issues/503"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8aacb2c7-873c-ff61-0b30-7c0ab4d6a424 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E31A:129B62:121FEDB:19752D5:6970CB18 |
| html-safe-nonce | c4b1aae09581c3685d3922ca30d8bb7c2e08532512504732e98de72489f49468 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzFBOjEyOUI2MjoxMjFGRURCOjE5NzUyRDU6Njk3MENCMTgiLCJ2aXNpdG9yX2lkIjoiMjc1MTE0ODAwNzY2NTc0ODc2MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a1b553f051f1c53225b1ae055017569cb5cc585b80d1de52e021420d83693086 |
| hovercard-subject-tag | issue:3567309017 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/boostorg/python/503/issue_layout |
| twitter:image | https://opengraph.githubassets.com/27237aaf449a33f0a950429ec915d491970182247249199d80510c8e4768ce39/boostorg/python/issues/503 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/27237aaf449a33f0a950429ec915d491970182247249199d80510c8e4768ce39/boostorg/python/issues/503 |
| og:image:alt | This issue is intended to track the efforts of adding support for the free-threaded build for CPython (3.14t and potentially 3.13t). The Python free-threading guide contains some helpful advice on ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nascheme |
| hostname | github.com |
| expected-hostname | github.com |
| None | 721764876e433c894814212f8100f6610f1dde78a987acc2e385d8be8e170e9c |
| turbo-cache-control | no-preview |
| go-import | github.com/boostorg/python git https://github.com/boostorg/python.git |
| octolytics-dimension-user_id | 3170529 |
| octolytics-dimension-user_login | boostorg |
| octolytics-dimension-repository_id | 7589968 |
| octolytics-dimension-repository_nwo | boostorg/python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7589968 |
| octolytics-dimension-repository_network_root_nwo | boostorg/python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6ff3d08f4ee1c3f89ebedf4df8fc8fe851190294 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width