-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add pika::wait
#704
Add pika::wait
#704
Conversation
bors try |
tryBuild failed: |
bors try |
tryBuild failed: |
This seems to have exposed some problems in |
This is on hold because I had forgotten about the probabilistic nature of checking if the runtime is idle. We don't have a global indicator to check that all of the thread pools and MPI/CUDA polling is idle, which means that it's inherently racy to individually check those for idleness and infer idleness of the runtime from those. We may need to try to introduce a global counter but we have to be careful not to kill performance with a global atomic counter. |
I've removed the test from this PR and left only the |
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.
LGTM thanks!
bors merge |
704: Add `pika::wait` r=msimberg a=msimberg Fixes #696. Calls `thread_manager::wait`. `pika::wait` can also be called on a pika thread, in which case it'll ignore the calling thread and wait for all other work to finished. The behaviour is undefined/will likely deadlock if `pika::wait` is called concurrently from multiple pika threads. Note, I made `wait` return an `int` to be consistent with the other related functions, but I opened #703 to possibly change it to `void`. Co-authored-by: Mikael Simberg <mikael.simberg@iki.fi>
Build failed: |
Merging despite failures, which seem to mostly be timeouts on header tests. |
Fixes #696.
Calls
thread_manager::wait
.pika::wait
can also be called on a pika thread, in which case it'll ignore the calling thread and wait for all other work to finished. The behaviour is undefined/will likely deadlock ifpika::wait
is called concurrently from multiple pika threads.Note, I made
wait
return anint
to be consistent with the other related functions, but I opened #703 to possibly change it tovoid
.