-
Notifications
You must be signed in to change notification settings - Fork 32
Description
The current documentation for FutureIterable.wait and the record extensions (e.g. FutureRecord2.wait, FutureRecord3.wait, etc.) states that they "Wait for futures in parallel."
Example from docs: future.dart & future_extensions
/// Waits for futures in parallel.
This wording is technically inaccurate.
Concurrency: multiple tasks are in progress at the same time, but may be interleaved on a single thread (as Dart Futures are, running on the event loop).
Parallelism: multiple tasks are executing simultaneously on multiple CPU cores.
In Dart, unless isolates are explicitly used, futures do not run in parallel; they run concurrently.
Why this matters:
Developers new to async may assume Dart is running their futures on multiple CPU cores, which is misleading.
Using “concurrent” is more precise, while still being understandable to most readers.
Proposed fix:
Update doc comments in dart:async extensions to say something like:
/// Waits for all futures to complete concurrently.
This keeps the intent clear while avoiding the incorrect use of “parallel.”