Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

colesbury
Copy link
Contributor

@colesbury colesbury commented Nov 21, 2024

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.

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.
@mpage
Copy link
Contributor

mpage commented Nov 21, 2024

Would it be worth adding a regression test?

@colesbury
Copy link
Contributor Author

I think it'll be better to rely on something similar to pytest-run-parallel on test_operator.py, but I will add a test case if you prefer.

@mpage
Copy link
Contributor

mpage commented Nov 21, 2024

I think it'll be better to rely on something similar to pytest-run-parallel on test_operator.py

sgtm

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