-
Notifications
You must be signed in to change notification settings - Fork 7
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
Spinlock Usage #12
Comments
This was discussed on our hackernews post quite a bit. The spinlock usage was due to my own misunderstanding of whether this counts as a spinlock due to queueing of tasks on the tokio global queue. A fair queueing system for reads and writes is in-progress but I haven't had the time lately to finish it up. Maybe I should replace the spinlocks with I'm sorry you find the benchmarks misleading, hopefully you can understand that this was due to a misunderstanding and not the intent to mislead :) |
Btw I've used |
Glad to hear this! I'm a bit apprehensive towards projects claiming to be super performant while relying heavily on spinlocks because the authors tend to remain convinced that spinlocks are not a problem. If this was just a misunderstanding and there is work to fix there's no harm done :)
This is probably a good idea yeah. As I mentioned the spinlock here is particularly problematic, and I do think that there is a use case for a better |
I guess what I'd end up with is probably just a reimplementation of an async |
Unless I'm missing something, this library seems to rely heavily on a pure spinlock. This implementation problematic for a number of reasons:
try_read
, which is typically an RMW operation. This is very inefficient and introduces unnecessary contention even when the lock state has not changed, without attempting to yield or perform backoff.Given that the benchmarks do not mention the use of spinlocks at all, I find the results very misleading. The spinlocks should be switched out for a real asynchronous lock, such as
tokio::sync::RwLock
.The text was updated successfully, but these errors were encountered: