October 2020
Intermediate to advanced
1088 pages
31h 19m
English
Begin 4.0Begin 5.0As we saw in Chapter 19, tasks provide an abstraction for the manipulation of asynchronous work. Tasks are automatically scheduled to the right number of threads, and large tasks can be composed by chaining together small tasks, just as large programs can be composed from multiple small methods.
However, there are some drawbacks to tasks. The principal difficulty with tasks is that they turn your program logic “inside out.” To illustrate this, we begin the chapter with a synchronous method that is blocked on an I/O-bound, high-latency operation—a web request. We then revise this method by leveraging the C# 5.0–introduced async/await contextual keywords, demonstrating a significant ...
Read now
Unlock full access