gh-121621: Move asyncio freelist to thread state by Fidget-Spinner · Pull Request #121915 · python/cpython · GitHub
Skip to content

gh-121621: Move asyncio freelist to thread state - #121915

Closed
Fidget-Spinner wants to merge 13 commits into
python:mainfrom
Fidget-Spinner:asyncio_clear_freelist
Closed

Fidget-Spinner wants to merge 13 commits into
python:mainfrom
Fidget-Spinner:asyncio_clear_freelist

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Jul 17, 2024

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anyone with better freelist internals knowledge know why this happens:

When I remove this function's body, the refleak tests pass. Otherwise they currently fail.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned by Sam we should try to find a way to avoid this.

@colesbury colesbury Jul 17, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we go with #121934, then that will make the asyncio freelist implementation a lot easier and will avoid a lot of these warts.

Maybe, in the meantime, we should just disable the freelist in the free-threaded build? That would be a much smaller change and wouldn't introduce duplicate types.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could backport the disabling of freelist in the free-threaded build to 3.13 to fix the race conditions.

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.

2 participants