Skip to content
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

Merged
merged 1 commit into from Feb 17, 2017
Merged

Conversation

sithhell
Copy link
Member

flyby: fix inspect

{
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());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this deleted?

Copy link
Member Author

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.

Copy link
Member

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;
Copy link
Member

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();
Copy link
Member

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
)
{
Copy link
Member

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.

@sithhell sithhell force-pushed the fix_background_handling branch 3 times, most recently from d5aef12 to bb24122 Compare February 16, 2017 22:34
@sithhell sithhell merged commit 10aaacc into master Feb 17, 2017
@sithhell sithhell deleted the fix_background_handling branch February 17, 2017 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants