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

Fix potential concurrency edge case #21

Merged
merged 1 commit into from
Apr 16, 2024
Merged

Conversation

JothamWong
Copy link
Member

The issue with the select check read and write is that they previously werent wrapped in an atomic block. What can happen is that the check read/write returns true, then the thread gets context switch and another thread violates the invariant that the channel to operate on. By wrapping up all checks and channel operations in atomic blocks, we ensure that this cannot happen.

The issue with the select check read and write is that they previously werent wrapped in an atomic block. What can happen is that the check read/write returns true, then the thread gets context switch and another thread violates the invariant that the channel to operate on. By wrapping up all checks and channel operations in atomic blocks, we ensure that this cannot happen.
@JothamWong JothamWong merged commit f764a46 into main Apr 16, 2024
1 check 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.

1 participant