async and await in C#

async and await in C#: Tasks, async and await, Waiting for Many Tasks: Task.WhenAll and Task.WhenAny.

Updated

  1. Tasks, async and await (Journeyman): A Task is work that finishes later. An async method can await a task, which frees its thread while it waits for a database or the network, so a web server can keep serving other requests. Await every async call, and name async methods with Async.
  2. Waiting for Many Tasks: Task.WhenAll and Task.WhenAny (Journeyman): Start several tasks before awaiting any of them, then wait for them all with Task.WhenAll, which takes about as long as the slowest, or for the first to finish with Task.WhenAny, which can also race slow work against a timer.