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

Operate on public data under Lock #1956

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

nanonyme
Copy link
Contributor

Fixes #1955

@nanonyme nanonyme force-pushed the nanonyme/thread-safety branch 3 times, most recently from 9e45e5c to 5a9c655 Compare September 22, 2024 10:31
@nanonyme nanonyme force-pushed the nanonyme/thread-safety branch 2 times, most recently from 51ed94e to f9389b7 Compare October 9, 2024 15:28
@nanonyme nanonyme force-pushed the nanonyme/thread-safety branch from f9389b7 to 9ef2044 Compare October 9, 2024 15:58
Copy link
Contributor

@juergbi juergbi left a comment

Choose a reason for hiding this comment

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

LGTM. As I understand it, the only possible race is between multiple get/load calls and there can't ever be a race between set_public_data() and get/load (as reverse dependencies must anyway wait until the build is complete), so the lock would not actually be needed everywhere. However, guarding every access of the variable is reasonable and this should have no noticeable performance impact, so I think it's fine to merge this as is.

@juergbi juergbi merged commit 35904f3 into apache:master Oct 14, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition in public data handling
2 participants