FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-127065: Make `methodcaller` thread-safe in free threading build by colesbury · Pull Request #127109 · python/cpython · GitHub

Repository navigation

gh-127065: Make methodcaller thread-safe in free threading build - #127109

Merged
colesbury merged 1 commit into
python:mainfrom
colesbury:gh-127065-methodcaller
Nov 22, 2024
Merged

colesbury merged 1 commit into
python:mainfrom
colesbury:gh-127065-methodcaller

Conversation

colesbury commented Nov 21, 2024 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

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 commented Nov 21, 2024

Copy link
Copy Markdown
Contributor

Would it be worth adding a regression test?

Copy link
Copy Markdown
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 commented Nov 21, 2024

Copy link
Copy Markdown
Contributor

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

sgtm

colesbury merged commit f83ca69 into python:main Nov 22, 2024

Copy link
Copy Markdown

Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

colesbury deleted the gh-127065-methodcaller branch November 22, 2024 14:22
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 22, 2024
…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 <colesbury@gmail.com>

bedevere-app Bot commented Nov 22, 2024

Copy link
Copy Markdown

GH-127150 is a backport of this pull request to the 3.13 branch.

bedevere-app Bot removed the needs backport to 3.13 only security fixes label Nov 22, 2024
colesbury added a commit that referenced this pull request Nov 22, 2024
…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 <colesbury@gmail.com>
ebonnal pushed a commit to ebonnal/cpython that referenced this pull request Jan 12, 2025
…ild (python#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL