8 Asynchronous Programming Models

IN THE LAST CHAPTER, we saw how to efficiently use threads through the higher level abstraction of thread pools. The .NET Framework goes one step further and has standard patterns for exposing the capability to run asynchronously. The implementations of this pattern typically use the CLR thread pool internally or layer on top of existing asynchronous OS services (such as file I/O), but the patterns accommodate common coordination needs. We’ll explore some OS specific facilities in Chapter 15, Input and Output, but a wonderful attribute about them is that most are exposed using these same common patterns in .NET.

The two most prevalent patterns follow.

• The asynchronous programming model (APM) is the most common ...

Get Concurrent Programming on Windows now with O’Reilly online learning.

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