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

Fix block_os_threads_1036 test #5619

Merged
merged 2 commits into from Oct 25, 2021

Conversation

msimberg
Copy link
Contributor

For more details see commit message: 9ddbb1f.

Flyby:

  • use references instead of pointers in the test (inconsequential, but I prefer this stylistically; happy to revert if someone prefers the old style)
  • fix barrier::arrive_and_drop: it would try to take the same lock in nested function calls

@hkaiser could you please have a look, especially at the barrier change, to see if it looks sane to you?

The started variable may be accessed by the "blocker" threads after it
has gone out of scope, leaving the blocker thread reading garbage from
started and the loop

while (started->load() != 1) continue;

never returning and the test hanging.

This adds a barrier at the end of the test to ensure that no variables
in the "blocker" threads are accessed after they go out of scope from
hpx_main. The rest of the test is meant to use never-suspending
primitives, but at the end of the test we can use a barrier which may
suspend.
hkaiser
hkaiser previously approved these changes Oct 22, 2021
Copy link
Member

@hkaiser hkaiser left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@msimberg msimberg merged commit cabeffb into STEllAR-GROUP:master Oct 25, 2021
@msimberg msimberg deleted the fix-block-os-threads-test branch October 25, 2021 09:26
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