Chapter 25. Asynchronous Methods and Parallel Loops

This chapter covers two features sets that are related to the Task Parallel Library discussed in Chapter 24. Asynchronous methods existed before the TPL was added to the .NET Framework and offer a simple alternative (albeit with less robust features) to using Tasks. This chapter will also cover parallel loops, which are built on top of the TPL and create parallel versions of for and foreach loops. Table 25-1 provides the summary for this chapter.

Table 25-1. Quick Problem/Solution Reference for Chapter 25

Problem

Solution

Listings

Perform an asynchronous operation on a library class that supports asynchronous methods.

Use the Begin and End methods.

25-1, 25-2

Call any method asynchronously.

Create a delegate ...

Get Introducing Visual C# 2010 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.