-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-127065: Make methodcaller
thread-safe in free threading build
#127109
Conversation
The `methodcaller` C vectorcall implementation uses an arguments array that is shared across calls. The first argument is modified on every invocation. This isn't thread-safe in the free threading build. I think it's also not safe in general, but for now just disable it in the free threading build.
Would it be worth adding a regression test? |
I think it'll be better to rely on something similar to pytest-run-parallel on |
sgtm |
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…ild (pythonGH-127109) The `methodcaller` C vectorcall implementation uses an arguments array that is shared across calls. The first argument is modified on every invocation. This isn't thread-safe in the free threading build. I think it's also not safe in general, but for now just disable it in the free threading build. (cherry picked from commit f83ca69) Co-authored-by: Sam Gross <[email protected]>
GH-127150 is a backport of this pull request to the 3.13 branch. |
…uild (GH-127109) (GH-127150) The `methodcaller` C vectorcall implementation uses an arguments array that is shared across calls. The first argument is modified on every invocation. This isn't thread-safe in the free threading build. I think it's also not safe in general, but for now just disable it in the free threading build. (cherry picked from commit f83ca69) Co-authored-by: Sam Gross <[email protected]>
The
methodcaller
C vectorcall implementation uses an arguments array that is shared across calls. The first argument is modified on every invocation. This isn't thread-safe in the free threading build. I think it's also not safe in general, but for now just disable it in the free threading build.methodcaller
is not thread-safe (or re-entrant) #127065