Improving throughput by using tasks

After completing the chapter, you will be able to:

  • Describe the benefits of implementing parallel operations in an application.

  • Use the Task class to create and run parallel operations in an application.

  • Use the Parallel class to parallelize some common programming constructs.

  • Cancel long-running tasks and handle exceptions raised by parallel operations.

In the bulk of the preceding chapters in this book, you’ve learned how to use C# to write programs that run in a single-threaded manner. By single-threaded, I mean that at any one point in time, a program has been executing a single instruction. This might not always be the most efficient approach for an application to take. If you have the appropriate ...

Get Microsoft Visual C# Step by Step, Ninth Edition now with the O’Reilly learning platform.

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