Asynchronous patterns

Since releasing the first version of C# and the .NET Framework, there has been built-in support for running asynchronous operations. Unfortunately, this infrastructure was quite complicated and hard to use, and this caused the next platform versions to include new ways (patterns) of writing asynchronous code that enhanced asynchronous programming experience.

Here, we will review three asynchronous programming patterns starting from the oldest:

  • APM: Asynchronous Programming Model (introduced in the .NET Framework 1.0)
  • EAP: Event-Based Asynchronous Pattern (released with the .NET Framework 2.0)
  • TAP: Task-Based Asynchronous Pattern (appeared with the .NET Framework 4.0)

The first two patterns are usually considered as legacy code ...

Get Mastering C# Concurrency now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.