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 optional scheduler mode parameter to create_thread_pool function #3230
Conversation
97d958f
to
724a3af
Compare
@@ -53,7 +54,8 @@ namespace hpx { namespace resource { namespace detail | |||
|
|||
private: | |||
init_pool_data(const std::string &name, | |||
scheduling_policy = scheduling_policy::unspecified); | |||
scheduling_policy = scheduling_policy::unspecified, | |||
hpx::util::optional<hpx::threads::policies::scheduler_mode> = hpx::util::nullopt); |
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.
Wouldn't it be simpler to define an enumerator value representing a 'default_mode'?
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.
Thanks @hkaiser once again for keeping me in check. That's a really good idea and further simplifies usage (because one can say "I want defaults plus this flag" or "I want defaults and definitely not this flag").
724a3af
to
2a70026
Compare
2a70026
to
7f4a8bc
Compare
@hkaiser I've rebased and updated this to add only a new enum value ( The timeout on |
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.
Thanks, LGTM now.
Proposed Changes
default_mode
value to the scheduler mode enumcreate_thread_pool
with a default value ofdefault_mode
Any background context you want to provide?
Addresses #3082, but I'm not sure what more we might want. This at least simplifies the use cases in the suspension tests (one does not need to use the callback version of
create_thread_pool
anymore to change scheduler modes).