-
Notifications
You must be signed in to change notification settings - Fork 12
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
index must be align #21
Comments
use align as less from https://en.cppreference.com/w/cpp/atomic/atomic_ref
|
but align by cacheline will be better and align for atomic too |
boost has align for all fields https://www.boost.org/doc/libs/1_63_0/boost/fiber/detail/context_mpsc_queue.hpp |
so strange |
Can I simply understand that to solve false-sharing? |
original work streal spmc from go but my opinion align must be present |
so you can close issues in my own implementation i will use cache align for indexs and buffer |
Yes |
iam look inside many implementation of spmc queue |
tail_ index can change to atomic this because golang has no memory model like C++ and has no "relaxed" memory model |
temporary update |
zedio/zedio/runtime/multi_thread/queue.hpp
Line 341 in 8eff804
atomic (rust and C++) by default has align
but uint32_t has no align
so false sharing will be decrease performance
The text was updated successfully, but these errors were encountered: