Saturday, August 19, 2017

Asynchronous and Parallel Programming in C#

History and current status

  • .NET Framework 1.1 - C# 1.1: Asynchronous Programming Model (APM).
  • .NET Framework 2 - C# 2: Event Asynchronous Pattern (EAP). 
  • .NET Framework 4 - C# 4: Task Parallel Library (TPL). Mostly multi-threading oriented.
  • .NET Framework 4.5 - C# 5: Asynchronous methods (async/await). Task Continuations are often not needed. Huge code noise reduction. Better support in the Basic Class Library (BCL). "Async" suffix in many methods. Mostly asynchronous programming oriented.
Today the preferred way to handle asynchronous programming is by using Tasks with async/await first and then TPL.

Caution! in the TPL world tasks are usually "Delegate tasks" (tied to threads) but async/await tasks are mostly "Promise tasks". See https://blog.stephencleary.com/2014/04/a-tour-of-task-part-0-overview.html

Extensions

Resources

No comments:

Post a Comment