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

Remove single-threadedness coming from rotation lock #6

Merged
merged 2 commits into from
Nov 11, 2024

Conversation

satmihir
Copy link
Owner

Using a single Mutex for all operations (updates and rotation) made all updates single threaded. This change addresses this problem using the RWMutex which treats updates as "reads" since they are allowed to happen concurrently and treats actual rotation as writes. Nothing can update while a rotation happens but multiple updates can happen at the same time while the rotation write lock is not held.

Addresses #5

Using a single Mutex for all operations (updates and rotation) made all updates single threaded. This change addresses this problem using the RWMutex which treats updates as "reads" since they are allowed to happen concurrently and treats actual rotation as writes. Nothing can update while a rotation happens but multiple updates can happen at the same time while the rotation write lock is not held.
@edyoung
Copy link
Collaborator

edyoung commented Nov 11, 2024

LGTM, thanks!

@satmihir satmihir merged commit 5b3f79f into main Nov 11, 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.

2 participants