From 4b35a76d4ee11a95df0bfdc4d836caa21c4b1c8f Mon Sep 17 00:00:00 2001 From: Kenta Murata <3959+mrkn@users.noreply.github.com> Date: Sat, 9 Mar 2024 21:26:00 +0900 Subject: [PATCH] Add usage note of waitall in docstring Co-authored-by: Jameson Nash --- base/task.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/base/task.jl b/base/task.jl index e7137e90ef3ce7..309ca43d632b13 100644 --- a/base/task.jl +++ b/base/task.jl @@ -377,6 +377,12 @@ completed tasks completes with an exception. The return value consists of two task vectors. The first one consists of completed tasks, and the other consists of uncompleted tasks. + +!!! warning + This may scale poorly compared to writing code that uses multiple individual tasks that + each runs serially, since this needs to scan the list of `tasks` each time and + synchronize with each one every time this is called. Or consider using + [`waitall(tasks; failfast=true)`](@ref waitall) instead. """ waitany(tasks; throw=true) = _wait_multiple(tasks, throw)