Skip to content

gh-120321: Make gi_frame_state transitions atomic in FT build#142599

Merged
colesbury merged 18 commits intopython:mainfrom
colesbury:gh-120321-gen-atomic
Dec 19, 2025
Merged

gh-120321: Make gi_frame_state transitions atomic in FT build#142599
colesbury merged 18 commits intopython:mainfrom
colesbury:gh-120321-gen-atomic

Conversation

@colesbury
Copy link
Contributor

@colesbury colesbury commented Dec 11, 2025

This makes generator frame state transitions atomic in the free threading build, which avoids segfaults when trying to execute a generator from multiple threads concurrently.

There are still a few operations that aren't thread-safe and may crash if performed concurrently on the same generator/coroutine:

  • Accessing gi_yieldfrom/cr_await/ag_await
  • Accessing gi_frame/cr_frame/ag_frame
  • Async generator operations

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants