-
Notifications
You must be signed in to change notification settings - Fork 4
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
Optimize shared data layout to avoid false sharing #3
Comments
So, what I want here is to align each buffer on a cache line boundary. The back-buffer index and the last buffer index can safely reside on the same cache line, because they are always accessed together. Two tracks to explore, neither of which is currently available in stable or nightly Rust, are...
|
It seems it's stable now. |
Indeed, and crossbeam-utils will introduce a sane version of CachePadded in their next release. Once they release that, it will probably be the right time to update triple-buffer. |
Crossbeam have pushed new releases last month, so I can investigate this now. |
Fixed in v3 |
The current implementation has minimal memory overhead, but can exhibit false sharing, which reduces the performance of concurrent reads and writes more than necessary. A more careful data layout could prevent this.
The text was updated successfully, but these errors were encountered: