Task Parallel Library TPL
suggest changeVersions
The Task Parallel Library ships in .NET Framework 4 and later (through 4.6.2 here). A separate NuGet package backports it to 3.5.
Remarks
Purpose And Use Cases
The purpose of the Task Parallel Library is to simplify the process of writing and maintaining multithreaded and parallel code.
Some Use Cases*:
- Keeping a UI responsive by running background work on a separate task
- Distributing workload
- Allowing a client application to send and receive requests at the same time (REST, TCP/UDP, and so on)
- Reading and/or writing multiple files at once
*Decide case by case. If a loop has only a few iterations, or each iteration does little work, the overhead of parallelism can outweigh the benefit.
TPL on .NET Framework 3.5
The TPL ships in .NET Framework 4. A NuGet backport, also called the Task Parallel Library, targets .NET Framework 3.5.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents