Skip to content

gh-148393: Use atomic ops on _ma_watcher_tag in free threading build#148397

Merged
colesbury merged 1 commit intopython:mainfrom
colesbury:gh-148393-atomic-watcher-tag
Apr 12, 2026
Merged

gh-148393: Use atomic ops on _ma_watcher_tag in free threading build#148397
colesbury merged 1 commit intopython:mainfrom
colesbury:gh-148393-atomic-watcher-tag

Conversation

@colesbury
Copy link
Copy Markdown
Contributor

@colesbury colesbury commented Apr 11, 2026

Fixes data races between dict mutation and watch/unwatch on the same dict.

…build

Fixes data races between dict mutation and watch/unwatch on the same dict.
Copy link
Copy Markdown
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this in the optimizer as well!

Copy link
Copy Markdown
Contributor

@mpage mpage left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Copy Markdown
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

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

lgtm!

@colesbury colesbury merged commit 3ab94d6 into python:main Apr 12, 2026
82 checks passed
@miss-islington-app
Copy link
Copy Markdown

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

@colesbury colesbury deleted the gh-148393-atomic-watcher-tag branch April 12, 2026 14:40
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Apr 12, 2026
…build (pythongh-148397)

Fixes data races between dict mutation and watch/unwatch on the same dict.
(cherry picked from commit 3ab94d684286b49144bf2e43cc1041f3e4c0cda8)

Co-authored-by: Sam Gross <colesbury@gmail.com>
@bedevere-app
Copy link
Copy Markdown

bedevere-app bot commented Apr 12, 2026

GH-148451 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Apr 12, 2026
colesbury added a commit that referenced this pull request Apr 12, 2026
… build (gh-148397) (#148451)

Fixes data races between dict mutation and watch/unwatch on the same dict.
(cherry picked from commit 3ab94d6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
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.

4 participants