# Wait for whichever task is first

**URL:** <https://discourse.julialang.org/t/wait-for-whichever-task-is-first/64588>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 13, 2021, 3:59pm UTC](https://discourse.julialang.org/t/wait-for-whichever-task-is-first/64588 "2021-07-13T15:59:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [July 13, 2021, 4:19pm UTC](https://discourse.julialang.org/t/wait-for-whichever-task-is-first/64588/2 "2021-07-13T16:19:57Z")

</div>

You can use channels or conditions — e.g. define a `Condition` and have the tasks call `notify` on it when they are done. Then you can just `wait` on that condition.

See also this discussion: [How to call wait on multiple Tasks? - #4 by Jeff\_Emanuel](https://discourse.julialang.org/t/how-to-call-wait-on-multiple-tasks/50981/4)

---

_[View the full topic](https://discourse.julialang.org/t/wait-for-whichever-task-is-first/64588)._
