Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 waitany and waitall functions to wait multiple tasks at once #53341
Add waitany and waitall functions to wait multiple tasks at once #53341
Changes from all commits
1fb6a95
7482838
5a30999
664f8a3
8ac6ddc
f459e8a
eb2bafd
d7cf9dc
9159247
573ee9f
1175779
633cb58
4bec8cd
b9dd9e6
ae0ca9d
93057e6
ed58eda
f1f400e
4d8e137
1a55697
22646dd
505d476
1c9adbf
58d1e02
3c9a9c8
4dd8862
34e3d41
8a7683f
d30c9c0
0a382a3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@vtjnash How do you think about splitting
_wait_multiple
forAbstractVector{Task}
and other types to avoid copying a vector?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.
To avoid the copy? That makes sense to me. Though I don't know if all AbstractVector support the bitmasking operations, I think that should be valid.
As food for thought also, in a later PR, I am thinking we should also seek to extend this to allow any other waitable events too, not just Tasks (e.g. Channels, Event, AsyncEvent, Timer, etc.) and either add the
throwexc
kwarg to those otherwait
functions (instead of calling it_wait
) or rename_wait
to something likewaitready
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 guess
a[mask]
is processed by_getindex(IndexStyle(a), a, LogicalIndex(mask)...)
, which then reaches_unsafe_getindex
defined in multidimensional.jl, so all AbstractVector support the bitmasking operations.I completely agree. As I wrote in issue #53226, I also thought that supporting waitable objects other than Tasks might be a good idea.
I think the non-throw version might be used as frequently as
wait
in real-world application development.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 submitted a new PR #53685 for introducing
throw
option inwait(::Task)
function.