O'Reilly logo

C# Multithreaded and Parallel Programming by Rodney Ringler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Task-based Parallelism

In this chapter we will cover the Task Parallel Library (TPL) and the details of using the Task class to write concurrent code.

In Chapter 5, Lightweight Concurrency – Task Parallel Library (TPL), we started our exploration of lightweight concurrency and .NET's new most preferred way to accomplish multithreaded programming—the TPL. In this chapter, we will explore task-based parallelism further and show how to wait on tasks or multiple tasks, custom scheduling of a task, error handling, and canceling a task.

The TPL gives us an easy way to schedule, run, and coordinate tasks at a higher level of abstraction than working directly with threads. As mentioned earlier, a task is a set of instructions to carry out an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required