-
Notifications
You must be signed in to change notification settings - Fork 189
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
Add a static single-producer single-consumer queue #5659
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The internal caching logic all looks right.
src/Parallel/StaticSpscQueue.hpp
Outdated
return try_emplace(std::forward<P>(v)); | ||
} | ||
|
||
/// Removes the first element from the queue and returns it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just returns it, doesn't remove.
src/Parallel/StaticSpscQueue.hpp
Outdated
std::array<T, capacity_ + 2 * padding_> data_{}; | ||
|
||
// Align to cache line size in order to avoid false sharing | ||
// readIndexCache_ and writeIndexCache_ is used to reduce the amount of cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update these to correct names
src/Parallel/StaticSpscQueue.hpp
Outdated
alignas(cache_line_size_) size_t write_index_cache_{0}; | ||
|
||
// Padding to avoid adjacent allocations from sharing a cache line with | ||
// writeIndexCache_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update name
6fb73f8
to
2f52e9b
Compare
Thanks for the reviews! I rebased and just squashed the minor documentation changes. |
Proposed changes
This is needed for efficient intra-node data transfers when using a nodegroup DG element setup.
Upgrade instructions
Code review checklist
make doc
to generate the documentation locally intoBUILD_DIR/docs/html
.Then open
index.html
.code review guide.
bugfix
ornew feature
if appropriate.Further comments