This chapter showed you how the C# 5.0 asynchronous methods and await expression language features simplify the building of responsive and scalable applications. Asynchrony is key to avoid blocking of threads, which has been very hard to get right in the past because of the invasive code restructuring required to work with the APM and EAP patterns.

Built on top of the Task-based Asynchronous Pattern (TAP), the language features for asynchronous programming provide an easier way to build asynchronous methods. Instead of having to reshuffle a logical flow of control into a bunch of continuations, await expressions leave this complex task to the compiler. As a result, you can focus on the job at hand, rather than on the plumbing required. ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

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