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 cv exceptions #1799

Merged
merged 2 commits into from Oct 19, 2015

Conversation

Projects
None yet
3 participants
@hkaiser
Copy link
Member

commented Oct 17, 2015

@sithhell reported that the segfault does not manifest itself if the mutex is not unlocked while releasing threads.

  • This patch also add proper handling of exceptions happening while executing notify_all.
  • Fly-by change makes slist::size constant time
Properly handle exceptional cases for condition_variable::notify_all
 - also fly-by change to make slist::size constant time
@sithhell

This comment has been minimized.

Copy link
Member

commented on hpx/lcos/local/detail/condition_variable.hpp in 25d9dce Oct 13, 2015

Shouldn't unlock be called anyway?

This comment has been minimized.

Copy link
Member Author

replied Oct 13, 2015

No, the queue_ has to be locked for the prepend_entries operation

This comment has been minimized.

Copy link
Member

replied Oct 14, 2015

Sure, but IIRC, the lock needs to be unlocked in the case we throw an exception.

This comment has been minimized.

Copy link
Member Author

replied Oct 14, 2015

Ok, good point. I'll change that.

This comment has been minimized.

Copy link
Member

replied Oct 14, 2015

The lock is being moved, so ownership of the lock is being transfered to prepend_entries, which will release it when done. It does not seem however that unlocking the mutex is something prepend_entries should be deciding.

@sithhell

This comment has been minimized.

Copy link
Member

commented on hpx/lcos/local/detail/condition_variable.hpp in 25d9dce Oct 13, 2015

So, potentially, we run into an infinite loop here, right?

This comment has been minimized.

Copy link
Member

replied Oct 13, 2015

I am not sure, but wouldn't aborting the remaining threads make more sense?

This comment has been minimized.

Copy link
Member Author

replied Oct 14, 2015

I think we can't create an infinite loop as the current thread was handled before the remaining items are prepended back onto the main queue. Also, I don't think terminating the remaining threads would be the right thing.

@hkaiser

This comment has been minimized.

Copy link
Member Author

commented Oct 19, 2015

All tests pass without a problem on gcc 4.6, 4.7, 4.8 and 4.9 debug and release resp.

sithhell added a commit that referenced this pull request Oct 19, 2015

@sithhell sithhell merged commit a725d04 into master Oct 19, 2015

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

@sithhell sithhell deleted the fixing_cv_exceptions branch Oct 19, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.