Task Parallel Library TPL
suggest changeVersions
[{“Name”:“3.5”,“GroupName”:”.NET”},{“Name”:“3.5 SP1”,“GroupName”:”.NET”},{“Name”:“4.0”,“GroupName”:”.NET”},{“Name”:“4.5”,“GroupName”:”.NET”},{“Name”:“4.5.1”,“GroupName”:”.NET”},{“Name”:“4.5.2”,“GroupName”:”.NET”},{“Name”:“4.6”,“GroupName”:”.NET”},{“Name”:“4.6.1”,“GroupName”:”.NET”},{“Name”:“4.6.2”,“GroupName”:”.NET”}]
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 separate task
- Distributing workload
- Allowing a client application to send and receive requests at the same time (rest, TCP/UDP, ect)
- Reading and/or writing multiple files at once
*Code should be considered on a case by case basis for multithreading. For example, if a loop only has a few iterations or only does a small amount of the work, the overhead for parallelism may outweigh the benefits.
TPL with .Net 3.5
The TPL is also available for .Net 3.5 included in a NuGet package, it is called Task Parallel Library.