Skip to content

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

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
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.

1 participant