Title: Allow C extensions to declare compatibility with free-threading · Issue #116322 · python/cpython · GitHub
Open Graph Title: Allow C extensions to declare compatibility with free-threading · Issue #116322 · python/cpython
X Title: Allow C extensions to declare compatibility with free-threading · Issue #116322 · python/cpython
Description: Feature or enhancement There are a few pieces to this: Add a Py_mod_gil slot, as described in PEP 703, that multi-phase init modules can use to indicate that they support free-threading. Add a PyModule_ExperimentalSetGIL() function (disc...
Open Graph Description: Feature or enhancement There are a few pieces to this: Add a Py_mod_gil slot, as described in PEP 703, that multi-phase init modules can use to indicate that they support free-threading. Add a PyMo...
X Description: Feature or enhancement There are a few pieces to this: Add a Py_mod_gil slot, as described in PEP 703, that multi-phase init modules can use to indicate that they support free-threading. Add a PyMo...
Opengraph URL: https://github.com/python/cpython/issues/116322
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow C extensions to declare compatibility with free-threading","articleBody":"# Feature or enhancement\r\n\r\nThere are a few pieces to this:\r\n1. Add a `Py_mod_gil` slot, as [described in PEP 703](https://peps.python.org/pep-0703/#py-mod-gil-slot), that multi-phase init modules can use to indicate that they support free-threading.\r\n2. Add a `PyModule_ExperimentalSetGIL()` function (discussed [here](https://github.com/python/cpython/pull/116882#discussion_r1575006053)) that single-phase init modules can use in place of `Py_mod_gil`.\r\n3. Mark all built-in modules as free-threading compatible with one of the above mechanisms.\r\n4. Enable the GIL while loading a C module and leave it permanently enabled if the module does not declare free-threading compatibility.\r\n\r\n1-3 are addressed in gh-116882; 4 will be addressed in a separate PR.\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-116882\r\n* gh-118560\n* gh-118645\n* gh-122268\n* gh-122282\n* gh-122284\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/swtaarrs","@type":"Person","name":"swtaarrs"},"datePublished":"2024-03-04T19:26:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/116322/cpython/issues/116322"}
| 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:e72cd49b-034e-fc38-2fd8-6894a4061720 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A148:207A9B:3F2359:56E7EC:696A0B4F |
| html-safe-nonce | ef4dad0bc22048a115ba3487ecc9f7fa3f9c209cff55455dfaefa8e5cf1999f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTQ4OjIwN0E5QjozRjIzNTk6NTZFN0VDOjY5NkEwQjRGIiwidmlzaXRvcl9pZCI6IjYwNDI3NjU3Njg4NTM2ODcxMTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1ab519f5b0979e75b3bafbb0aa88f7c2542e24407196333a1bf3da5f5de03935 |
| hovercard-subject-tag | issue:2167582143 |
| 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/python/cpython/116322/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d4bb51b8a4e7c37605bf19d183f36760b61175d1b93196d74a39e92917c16f6a/python/cpython/issues/116322 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d4bb51b8a4e7c37605bf19d183f36760b61175d1b93196d74a39e92917c16f6a/python/cpython/issues/116322 |
| og:image:alt | Feature or enhancement There are a few pieces to this: Add a Py_mod_gil slot, as described in PEP 703, that multi-phase init modules can use to indicate that they support free-threading. Add a PyMo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | swtaarrs |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| 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 | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width