]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-146219: Document reusing a thread state across repeated foreign-thread calls ... main
authorGregory P. Smith <68491+gpshead@users.noreply.github.com>
Tue, 30 Jun 2026 00:05:02 +0000 (17:05 -0700)
committerGitHub <noreply@github.com>
Tue, 30 Jun 2026 00:05:02 +0000 (17:05 -0700)
commit5717518fb3ed6f34716683e08ec372267d871d21
treeb3ca446fee33d6bc543c2f2fc09ce28751f11920
parent2dd6e59aea24220975cce2b602846d997413d46c
gh-146219: Document reusing a thread state across repeated foreign-thread calls (GH-146221)

* Document reusing a thread state across repeated foreign-thread calls

Add a subsection under "Non-Python created threads" explaining the
performance cost of creating/destroying a PyThreadState on every
Ensure/Release cycle and showing how to keep one alive for the
thread's lifetime instead.

* add a comma

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Doc/c-api/threads.rst