WHAT’S IN THIS CHAPTER?
WROX.COM CODE DOWNLOADS FOR THIS CHAPTER
The most important change of C# 5 is the advances provided with asynchronous programming. C# 5 adds only two new keywords:
await. These two keywords are the main focus of this chapter.
With asynchronous programming a method is called that runs in the background (typically with the help of a thread or task), and the calling thread is not blocked.
In this chapter, you can read about different patterns on asynchronous programming such as the asynchronous pattern, the event-based asynchronous pattern, and the new task-based asynchronous pattern (TAP). TAP makes use of the
await keywords. Comparing these patterns you can see the real advantage of the new style of asynchronous programming.
After discussing the different patterns, you will see the foundation of asynchronous programming by creating tasks and invoking asynchronous methods. You’ll learn about what’s behind the scenes with continuation tasks and the ...