René's URL Explorer Experiment


Title: Tracking issue for free-threading docs · Issue #145912 · python/cpython · GitHub

Open Graph Title: Tracking issue for free-threading docs · Issue #145912 · python/cpython

X Title: Tracking issue for free-threading docs · Issue #145912 · python/cpython

Description: Documentation Summary This is a tracking issue for the ongoing effort to improve thread safety documentation in CPython, covering both Python-level guarantees for built-in types and C API-level annotations for extension authors. Complete...

Open Graph Description: Documentation Summary This is a tracking issue for the ongoing effort to improve thread safety documentation in CPython, covering both Python-level guarantees for built-in types and C API-level ann...

X Description: Documentation Summary This is a tracking issue for the ongoing effort to improve thread safety documentation in CPython, covering both Python-level guarantees for built-in types and C API-level ann...

Opengraph URL: https://github.com/python/cpython/issues/145912

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tracking issue for free-threading docs","articleBody":"### Documentation\n\n## Summary\n\nThis is a tracking issue for the ongoing effort to improve thread safety documentation in CPython, covering both Python-level guarantees for built-in types and C API-level annotations for extension authors.\n\n## Completed work\n\n### Thread safety page and built-in type guarantees (gh-142518)\n\n- [x] Define free-threading related terms in the glossary\n- [x] gh-142519\n- [x] gh-144184\n- [x] gh-144716\n- [x] gh-145224\n\n### C API thread safety annotations (gh-145254)\n\n- [x] Define five annotation levels: `incompatible`, `compatible`, `distinct`, `shared`, `atomic`\n- [x] gh-145255\n- [x] Add thread safety levels reference section to `threadsafety.rst`\n- [x] Open python-docs-theme PR for rendering support\n\n## In progress (at the time of writing)\n\n- [x] gh-145225\n- [x] gh-145226\n- [x] gh-145911\n- [x] gh-145875 \n- [x] gh-146109\n\n\n## Remaining work\n\n### stdlib type documentation\n\nAfter built-in types, document thread-safety guarantees for stdlib types. Suggested priority:\n\n- [ ] `collections.deque` - widely used as a thread-safe queue substitute; people already assume it's safe; heavily used in asyncio internals\n- [ ] `io` types (`BufferedReader`, `BufferedWriter`, `TextIOWrapper`) - file I/O is inherently concurrent in real programs; existing thread-safety notes are scattered and incomplete\n- [ ] `collections.defaultdict` - the `__missing__` call introduces non-obvious concurrency questions (factory call is not atomic with insertion)\n- [ ] `collections.OrderedDict` - has its own internal locking that differs from plain dict\n- [ ] `collections.Counter` - commonly used for aggregation across threads\n- [ ] `array.array` - mutable typed array, relevant for numeric/scientific code going parallel\n\nRationale: `deque` first because it's the most likely to be shared across threads today. `io` types next because concurrent file access is common and the current docs are inadequate. The `collections` types after that, ordered by usage frequency and concurrency risk. `array.array` last - niche usage, but mutable so still worth documenting.\n\n### Free-threading programming guide (new HOWTO)\n\nA new `Doc/howto/free-threading-guide.rst`, alongside the existing two free-threading HOWTOs. The existing `free-threading-python.rst` stays focused on \"what is free-threading / what changed.\" The new guide focuses on **how to write correct concurrent code**.\n\nTopics to cover:\n\n- [ ] Single operations vs. compound operations - why \"thread-safe\" doesn't mean \"atomic\"\n- [ ] Common pitfalls: check-then-act, read-modify-write, iterating shared containers\n- [ ] When and how to use `threading.Lock` and other synchronization primitives\n- [ ] Practical patterns: queues, `concurrent.futures`, thread-local storage\n- [ ] Testing and debugging strategies (ThreadSanitizer, running under free-threaded builds)\n- [ ] Summary reference table of built-in type thread safety (quick lookup, links to detailed per-type docs)\n\nCross-reference from `free-threading-python.rst` and from the per-type thread safety page.\n\n### `asyncio` free-threaded guide\n\n- [ ] https://github.com/python/cpython/pull/150456\n\n### Other documentation gaps\n\n- [ ] Review and improve `queue` module docs w.r.t. free-threaded builds\n- [ ] Address gh-84992\n- [ ] Address gh-83556\n\n### C API annotations\n\n- [ ] Annotate `PyObject_*` APIs (creation, attribute access, comparison, etc.)\n- [ ] Annotate abstract layer APIs \n  \t- [ ] `PySequence_*`\n  \t- [ ] `PyMapping_*`\n  \t- [ ] `PyNumber_*`\n  \t- [ ] `PyIter_*`\n- [ ] Annotate reference counting APIs (`Py_INCREF`, `Py_DECREF`, `Py_NewRef`, etc.)\n- [ ] Annotate GIL/critical-section APIs\n- [ ] Annotate concrete type APIs\n\t- [x] `PyList_*`\n\t- [x] `PyDict_*`\n\t- [x] `PySet_*`\n\t- [x] `PyTuple_*`\n\t- [ ] `PyUnicode_*`\n- [ ] Annotate buffer protocol APIs (`PyObject_GetBuffer`, `PyBuffer_Release`, etc.)\n- [ ] Systematically work through remaining high-usage C API functions\n\n### Infrastructure improvements\n\n- [ ] Coordinate with gh-116738 (audit all built-in modules for thread safety) - ensure doc annotations stay in sync with implementation fixes\n- [ ] Add CI/linting to validate `threadsafety.dat` entries match actual function signatures\n- [ ] Consider generating per-module thread safety summary tables - especially in modules where it makes sense like `collections`\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-161162\n* gh-161165\n* gh-161516\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/lysnikolaou","@type":"Person","name":"lysnikolaou"},"datePublished":"2026-03-13T13:44:28Z","url":"https://github.com/python/cpython/issues/145912"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:4dcfc2f3-b7c7-ff35-7c63-f6f6a99f6ff8
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idECD8:1F2F:18E95E7:21199FF:6B01FF19
html-safe-nonce12f85cd6c02a64416996c79be69ca3756739187b32b53df292229a4e841cd05a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0Q4OjFGMkY6MThFOTVFNzoyMTE5OUZGOjZCMDFGRjE5IiwidmlzaXRvcl9pZCI6IjgxNjkzMTUwODkxNDk3MjIzOTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca8e5e5c97dc87ad3fa0e56079860e150fd47bc7ff0383c562f3fef84b8ce222b
hovercard-subject-tagissue:4071213046
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/145912/issue_layout
twitter:imagehttps://opengraph.githubassets.com/047ebe7ed834a794fa60d74a5b45850fb49a7365d590c3509f0b50f758d645a9/python/cpython/issues/145912
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/047ebe7ed834a794fa60d74a5b45850fb49a7365d590c3509f0b50f758d645a9/python/cpython/issues/145912
og:image:altDocumentation Summary This is a tracking issue for the ongoing effort to improve thread safety documentation in CPython, covering both Python-level guarantees for built-in types and C API-level ann...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamelysnikolaou
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/145912#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F145912
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F145912
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/145912
Reloadhttps://github.com/python/cpython/issues/145912
Reloadhttps://github.com/python/cpython/issues/145912
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/145912
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/145912
Tracking issue for free-threading docshttps://github.com/python/cpython/issues/145912#top
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
https://github.com/lysnikolaou
lysnikolaouhttps://github.com/lysnikolaou
on Mar 13, 2026https://github.com/python/cpython/issues/145912#issue-4071213046
gh-142518https://github.com/python/cpython/issues/142518
gh-142518: Document thread-safety guarantees of list operations #142519https://github.com/python/cpython/pull/142519
gh-142518: Document thread-safety guarantees of dict operations #144184https://github.com/python/cpython/pull/144184
gh-142518: Move thread safety sections into a new page #144716https://github.com/python/cpython/pull/144716
gh-142518: Improve mimalloc allocator docs #145224https://github.com/python/cpython/pull/145224
gh-145254https://github.com/python/cpython/issues/145254
gh-145254: Add thread safety annotation #145255https://github.com/python/cpython/pull/145255
gh-142518: Document thread-safety guarantees of set objects #145225https://github.com/python/cpython/pull/145225
gh-142518: Document thread-safety guarantees of bytearray objects #145226https://github.com/python/cpython/pull/145226
gh-142518: Add thread safety notes for the buffer protocol #145911https://github.com/python/cpython/pull/145911
gh-142518: Annotate PyDict_* C APIs for thread safety #145875https://github.com/python/cpython/pull/145875
gh-142518: Annotate PyList_* C APIs for thread safety #146109https://github.com/python/cpython/pull/146109
add asyncio guide for Free-Threaded Python #150456https://github.com/python/cpython/pull/150456
Multiprocessing docs don't describe thread-safety #84992https://github.com/python/cpython/issues/84992
Document os.environ[x] = y and os.putenv() as thread unsafe #83556https://github.com/python/cpython/issues/83556
Audit all built-in modules for thread safety #116738https://github.com/python/cpython/issues/116738
gh-145912: Fix stale and incorrect free-threading statements in the docs #161162https://github.com/python/cpython/pull/161162
gh-145912: Add a free-threading section on testing with ThreadSanitizer #161165https://github.com/python/cpython/pull/161165
gh-145912: Fix some out of date or now missing FT documentation #161516https://github.com/python/cpython/pull/161516
lysnikolaouhttps://github.com/lysnikolaou
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
on Mar 13, 2026https://github.com/python/cpython/issues/145912#event-23546681435
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Mar 13, 2026https://github.com/python/cpython/issues/145912#event-23546684192
github-project-automationhttps://github.com/apps/github-project-automation
docs issueshttps://github.com/orgs/python/projects/52
on Mar 13, 2026https://github.com/python/cpython/issues/145912
lysnikolaouhttps://github.com/lysnikolaou
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
on Mar 13, 2026https://github.com/python/cpython/issues/145912#event-23547006268
https://github.com/espressolee
espressoleehttps://github.com/espressolee
on Aug 8, 2026https://github.com/python/cpython/issues/145912#issuecomment-5224436859
python-pillow/Pillow#9852https://github.com/python-pillow/Pillow/issues/9852
GrahamDumpleton/wrapt#347https://github.com/GrahamDumpleton/wrapt/issues/347
gh-150044https://github.com/python/cpython/issues/150044
https://github.com/kojikojikojikoji
kojikojikojikojihttps://github.com/kojikojikojikoji
on Oct 21, 2026https://github.com/python/cpython/issues/145912#issuecomment-6316500577
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/145912
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/145912
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
3.15bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.15%22
docsDocumentation in the Doc dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22docs%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
docs issueshttps://github.com/orgs/python/projects/52
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.