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
Conversation
typedef hpx::lcos::local::spinlock mutex_type; | ||
mutex_type sender_threads_mtx_; | ||
std::list<threads::thread_id_type> sender_threads_; | ||
|
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.
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)?
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.
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) |
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.
I believe, this has to be:
if(get_runtime().get_state() < runtime::state_shutdown)
instead.
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.
Note, that the '!'
is superfluous in any case.
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.
Good point!
Attempting to fix hangs during shutdown.
This commit is attempting to fix distributed hangs that manifested during shutdown.