Here's an MSDN article on using async-awaitmultilpe for parallel processing of tasks. And here is another one that is specifically designed for a set of tasks.
In short, you can do one of the following:
Run all of your tasks, and then awaiteach of them. All of them will work in parallel, and your program will continue as soon as they are all completed.
Put your tasks in the collection and then use await Task.WhenAllto wait for several tasks.
An example of the second method will be as follows:
List<string> Syms = ...
IEnumerable<Task<decimal>> tasks = from Sym in Syms select GoToWeb(Sym);
decimal[] results = await Task.WhenAll(tasks);
source
share