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
Fixing background work invocations #2506
Conversation
{ | ||
struct tls_tag {}; | ||
static hpx::util::thread_specific_ptr<thread_id_type, tls_tag> thrd; | ||
if (thrd.get() == nullptr) thrd.reset(new thread_id_type()); |
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.
Where is this deleted?
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.
It's deleted in the dtor of thread_specific_ptr
.
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.
thread_id_type& background_thread() | ||
{ | ||
struct tls_tag {}; | ||
static hpx::util::thread_specific_ptr<thread_id_type, tls_tag> thrd; |
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.
Why is the background thread stored in a thread-local variable. Wouldn't be sufficient to have it on the stack as before?
{ | ||
thrd_stat = (*background_thread())(); | ||
|
||
thread_data *tmp = thrd_stat.get_next_thread(); |
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.
Could we use a variable name which is more descriptive, please?
SchedulingPolicy& scheduler, | ||
std::size_t num_thread | ||
) | ||
{ |
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.
Please align the code formatting to the rest of the file.
d5aef12
to
bb24122
Compare
flyby: fix inspect
bb24122
to
2284dda
Compare
flyby: fix inspect