Skip to content

[3.15] gh-146219: Document reusing a thread state across repeated foreign-thread calls (GH-146221)#152644

Merged
gpshead merged 1 commit into
python:3.15from
miss-islington:backport-5717518-3.15
Jun 30, 2026
Merged

[3.15] gh-146219: Document reusing a thread state across repeated foreign-thread calls (GH-146221)#152644
gpshead merged 1 commit into
python:3.15from
miss-islington:backport-5717518-3.15

Conversation

@miss-islington

@miss-islington miss-islington commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • 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


(cherry picked from commit 5717518)

Co-authored-by: Gregory P. Smith 68491+gpshead@users.noreply.github.com
Co-authored-by: Peter Bierma zintensitydev@gmail.com

…ign-thread calls (pythonGH-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>

---------
(cherry picked from commit 5717518)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Jun 30, 2026
@gpshead gpshead enabled auto-merge (squash) June 30, 2026 00:06
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Jun 30, 2026
@gpshead gpshead merged commit ac20726 into python:3.15 Jun 30, 2026
39 of 40 checks passed
@miss-islington miss-islington deleted the backport-5717518-3.15 branch June 30, 2026 00:13
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news topic-free-threading

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants