-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
sharded.hh: add invoke_on variant for a shard range #2449
sharded.hh: add invoke_on variant for a shard range #2449
Conversation
6ce5244
to
29da27b
Compare
@@ -35,6 +35,8 @@ | |||
#include <boost/iterator/counting_iterator.hpp> |
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.
sharded.hh: add invoke_on variant for a shard range
Missing patch changelog
include/seastar/core/sharded.hh
Outdated
requires std::invocable<Func, Service&, Args...> | ||
&& std::is_same_v<futurize_t<std::invoke_result_t<Func, Service&, internal::sharded_unwrap_t<Args>...>>, future<>> | ||
future<> | ||
invoke_on(unsigned begin, unsigned end, smp_submit_to_options options, Func func, Args... args) noexcept; |
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.
Better: pass a std::ranges::range of shards. Then any subset of the shards can be sent. If you want a contiguous range, use std::views::iota.
29da27b
to
a0f6802
Compare
84d1bc9
to
5e046b9
Compare
Add a convenient method to invoke a function on a range of shards, to have better support for the cold control path on more complex compute models like shard groups for different tasks. A workload can benefit from such a model if inter-task cooperation is better when grouping from perf and QoS perspectives, for example. Or a computation requires a only a subset of shards due to internal concurrency limits.
5e046b9
to
8c323e6
Compare
@avikivity changed to |
Add a convenient method to invoke a function on a range of shards, to have better support for the cold control path on more complex compute models like shard groups for different tasks. A workload can benefit from such a model if inter-task cooperation is better when grouping from perf and QoS perspectives, for example. Or a computation requires a only a subset of shards due to internal concurrency limits.