Title: Add a Per-Interpreter "HEAD" Lock · Issue #114940 · python/cpython · GitHub
Open Graph Title: Add a Per-Interpreter "HEAD" Lock · Issue #114940 · python/cpython
X Title: Add a Per-Interpreter "HEAD" Lock · Issue #114940 · python/cpython
Description: Feature or enhancement We have a lock that we use for thread-safety when working with the set of interpreters: _PyRuntimeState.interpreters.mutex. We use two macros in several core files to manage that lock: HEAD_LOCK() and HEAD_UNLOCK()...
Open Graph Description: Feature or enhancement We have a lock that we use for thread-safety when working with the set of interpreters: _PyRuntimeState.interpreters.mutex. We use two macros in several core files to manage ...
X Description: Feature or enhancement We have a lock that we use for thread-safety when working with the set of interpreters: _PyRuntimeState.interpreters.mutex. We use two macros in several core files to manage ...
Opengraph URL: https://github.com/python/cpython/issues/114940
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add a Per-Interpreter \"HEAD\" Lock","articleBody":"# Feature or enhancement\n\nWe have a lock that we use for thread-safety when working with the set of interpreters: `_PyRuntimeState.interpreters.mutex`. We use two macros in several core files to manage that lock: `HEAD_LOCK()` and `HEAD_UNLOCK()` (from pycore_pystate.h).\n\nRecently we've begun using that runtime-global lock for thread-safety when working with a single interpreter's set of thread states (`PyInterpreterState.threads`). The problem is that this means we are potentially blocking interpreters unnecessarily.\n\nThus it makes sense to introduce an interpreter-specific \"head\" lock: `PyInterpreterState.threads.mutex` (plus corresponding macros).\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-125561\n* gh-127037\n* gh-127077\n* gh-127115\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2024-02-02T22:42:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/114940/cpython/issues/114940"}
| 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:fe249331-1073-a179-e08c-e7a7c6acf6df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9444:33585E:6184D83:8966CE0:6A574863 |
| html-safe-nonce | 1e55fbc4a88f1d0a4604b77b39491819bd6e325652283945c9df405e435ee3f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDQ0OjMzNTg1RTo2MTg0RDgzOjg5NjZDRTA6NkE1NzQ4NjMiLCJ2aXNpdG9yX2lkIjoiNzc2ODE2MzY2MTkyODQxNzM3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 1a5cfa300e95f0c4a92a1e060c860be3382927d227ad50bc6e55686a81df67e0 |
| hovercard-subject-tag | issue:2115935784 |
| 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/114940/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b682412b8720063730a4c47783e5ad63cdbea7137530a9cb7c6ee003039a328e/python/cpython/issues/114940 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b682412b8720063730a4c47783e5ad63cdbea7137530a9cb7c6ee003039a328e/python/cpython/issues/114940 |
| og:image:alt | Feature or enhancement We have a lock that we use for thread-safety when working with the set of interpreters: _PyRuntimeState.interpreters.mutex. We use two macros in several core files to manage ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ericsnowcurrently |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4e7a7296a3830877cf21a6ad2a972c9e618a48915e03966cf0c53eb08e5aad98 |
| 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 | 602250ea3b6dd8302a7220ef98adb828dbc807e4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width