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
Do not depend on mutex #1
base: master
Are you sure you want to change the base?
Conversation
CI test fails because this PR uses |
No reason in particular. I don't mind bumping the minimum Rust version up. However I'm not sure about replacing the mutex with what is effectively a spin lock. Do you have a reason for wanting to avoid a mutex here? |
Hmm, I just assumed that I first thought that the redundancy of the mutex and By the way, just for curiosity :) can I ask why this repo is separate from your |
It's not really a performance reason, it's just that the seqlock only works when there is a single writer at a time. I generally prefer proper mutexes over spinlocks because it avoids issues when a thread is descheduled while holding a lock.
Again, no real reason. It just didn't feel like a proper part of |
This PR removes dependence on another mutex, and instead use the
seq: AtomicUsize
variable inSeqlock
as the mutex variable.