The Task Parallel Library (TPL) encompasses various .NET programming constructs, including parallel loops, parallel invocations, PLINQ, and task-based async programming. In Chapter 5, we explored async programming with
Task objects. This chapter will delve deeper into the
System.Threading.Tasks.Parallel members in the TPL and some additional tasking concepts for handling related tasks.
The lines between parallel programming, concurrency, and asynchronous programming are not always clear-cut, and you will discover where the three concepts intersect as we read ahead.
In this chapter, you will learn the following:
- Getting started with the TPL
- Parallel loops in .NET
- Relationships between parallel tasks
- Common pitfalls with parallelism
By the end of this chapter, you will understand how to use parallel programming in your own projects, why you would choose a parallel loop over a standard loop, and when to use