CHAPTER 35

image

Asynchronous and Parallel Programming

In modern programs, it’s common to need to run code in small chunks to keep user interfaces responsive and to run operations in parallel to reduce latency and take advantage of multicore CPUs. C# and the .NET Framework provide the following support for asynchronous and parallel programming:

  • The Task Parallel Library
  • C# language support for asynchronous execution (async and await keywords)
  • Parallel Linq (PLINQ)

This chapter explores how to use these facilities.

History

In earlier version of the .NET Framework, there were two ways of doing an asynchronous operation. The first one was used for I/O ...

Get A Programmer's Guide to C# 5.0, 4th Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.