Skip to content

gh-117657: Disable the function/code cache in free-threaded builds - #118301

Merged
colesbury merged 3 commits into
python:mainfrom
mpage:gh-117657-tsan-func-setversion
May 3, 2024
Merged

colesbury merged 3 commits into
python:mainfrom
mpage:gh-117657-tsan-func-setversion

Conversation

@mpage

@mpage mpage commented Apr 26, 2024 •

Copy link
Copy Markdown
Contributor

This is only used by the specializing interpreter and the tier 2 optimizer, both of which are disabled in free-threaded builds.

Additionally, make function version generation thread-safe in free-threaded builds. I don't think anything outside of the specializing interpreter / tier 2 optimizer actually uses this, so we could allow version generation to race if we're concerned about introducing a bottleneck with the lock.

Sample race that is fixed.

This is only used by the specializing interpreter and the tier 2
optimizer, both of which are disabled in free-threaded builds.

[Sample race](https://gist.github.com/mpage/d05a1c4616eedc9337f3f335e6485f91) that is fixed.
@mpage
mpage requested a review from colesbury May 1, 2024 21:22
@mpage
mpage marked this pull request as ready for review May 1, 2024 21:22
@mpage
mpage requested a review from markshannon as a code owner May 1, 2024 21:22
@colesbury
colesbury merged commit 37d0950 into python:main May 3, 2024
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
…lds (python#118301)

This is only used by the specializing interpreter and the tier 2
optimizer, both of which are disabled in free-threaded builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants