-
Notifications
You must be signed in to change notification settings - Fork 42
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
Improvement of node synchronization #29
Labels
enhancement
New feature or request
Comments
Okay, seqlocks didn't work for us, let's try RCU. |
maypok86
added a commit
that referenced
this issue
Jan 9, 2024
This was referenced Jan 10, 2024
maypok86
added a commit
that referenced
this issue
Jan 10, 2024
maypok86
added a commit
that referenced
this issue
Jan 10, 2024
maypok86
added a commit
that referenced
this issue
Jan 10, 2024
I think I'm fine with that for now |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Clarification and motivation
Currently otter uses spinlocks to synchronize nodes while getting values/updating information in nodes. This solution blocks reading values from the same node and slows down reads a lot. Unfortunately, we can't use sync.RWMutex because of xadd operations inside it, and since the amount of work under locks is very small, we will get the same speed, but will waste more memory than spinlock. There are several solutions to this problem:
atomic.Value
to store values. This solution leads to fantastic speed of reads/updates, but will require additional 16 bytes per node to store an empty interface and unnecessary allocation for each value.-race
flag was not passed, but still not very nice.Acceptance criteria
The text was updated successfully, but these errors were encountered: