All notes

Task parallelism

Async Patterns

MSDN: Asynchronous Programming Patterns and SO: three async methods provides a summary on "Asynchronous Programming Patterns" in C#. They are:

Task parallelism

MSDN: Task Parallel Library.

using System;
using System.Threading;
using System.Threading.Tasks;

public class Example
   public static void Main()
      Thread.CurrentThread.Name = "Main";

      // Create a task and supply a user delegate by using a lambda expression. 
      Task taskA = new Task( () => Console.WriteLine("Hello from taskA."));
      // Start the task.

      // Output a message from the calling thread.
      Console.WriteLine("Hello from thread '{0}'.", 
// The example displays output like the following:
//       Hello from thread 'Main'.
//       Hello from taskA.