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

Attempting to fix hangs during shutdown. #1345

Merged
merged 6 commits into from Jan 9, 2015
Merged

Conversation

sithhell
Copy link
Member

@sithhell sithhell commented Jan 8, 2015

This commit is attempting to fix distributed hangs that manifested during shutdown.

typedef hpx::lcos::local::spinlock mutex_type;
mutex_type sender_threads_mtx_;
std::list<threads::thread_id_type> sender_threads_;

Copy link
Member

Choose a reason for hiding this comment

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

How many threads do you expect to be active at the same time? Would a std::set be more appropriate to avoid the linear search (see L776)?

Copy link
Member Author

Choose a reason for hiding this comment

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

A std::set might indeed be more appropriate. This way we can avoid one linear search. We need one linear search to scan for suspended threads though. The maximum number of active threads is limited by the maximum connections in the cache.

    - race condition in mutex caused by spurios wakeups
    - avoiding locks being hold during suspension in locality and symbol namespace (this led to hangs at startup)
BOOST_FOREACH(refcnt_requests_type::const_reference e, *p)
// Only send decref requests if we aren't in shutdown mode, if we shut down, the corresponding
// component will get destroyed eventually.
if(!get_runtime().get_state() != runtime::state_shutdown)
Copy link
Member

Choose a reason for hiding this comment

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

I believe, this has to be:

 if(get_runtime().get_state() < runtime::state_shutdown)

instead.

Copy link
Member

Choose a reason for hiding this comment

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

Note, that the '!' is superfluous in any case.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point!

sithhell added a commit that referenced this pull request Jan 9, 2015
Attempting to fix hangs during shutdown.
@sithhell sithhell merged commit aa9b143 into master Jan 9, 2015
@sithhell sithhell deleted the parcelport_fix_hang branch January 9, 2015 17:16
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