Why Asynchronous Programming Matters

Throughout the previous chapters, you have repeatedly seen useful cases of asynchronous programming. For example, instead of blocking and waiting for a delegate invocation to complete, we can use the Begin/End pair of methods to avoid blocking. Similarly, when dealing with I/O operations, it’s very common to use an asynchronous approach to perform the operations to prevent blocked user interfaces.

Unfortunately, asynchronous programming has been notoriously hard due to the required usage of coding patterns that have an invasive effect on the structure of your code. Moreover, error handling, cancellation, progress tracking, resource management, and so on are very tedious and error-prone to wire up in an asynchronous ...

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.