The Task Parallel Library makes it possible to combine asynchronous tasks and set dependencies between them. In the previous chapter, we reviewed this topic in detail. However to get a clear understanding in this chapter, we will use this approach to solve a real problem—downloading images from Bing (the search engine). Also, we will do the following:
Implement standard synchronous approach
Use Task Parallel Library to create an asynchronous version of the program
Use C# 5.0 built-in asynchrony support to make the code easier to read and maintain
Simulate C# asynchronous infrastructure with the help of iterators
Learn about other useful features of Task Parallel Library
Make any C# type compatible with built-in asynchronous keywords