We have understood the background of the Task parallel library in the previous post. Now we need to concentrate on the building blocks of the library namely Task, Task scheduler, Blocking collection and the PLINQ.
Each of the TPL block has description of the features and example(s) associated with it. In this article I would like to discuss about the “Task” in this post.
Task
Coming right from the world of System.Threading.Thread a task looks little different. A TPL Task is nothing but a well wrapped Thread and having good infrastructure. TPL is still wrapped around the same namespace. TPL Task can be found in the namespace Syste.Threading.Tasks. TPL task has same ability to of a Thread object and been extended.
The below code shows how a thread and a TPL task can be used in typical scenarios
Each of the TPL block has description of the features and example(s) associated with it. In this article I would like to discuss about the “Task” in this post.
Task
Coming right from the world of System.Threading.Thread a task looks little different. A TPL Task is nothing but a well wrapped Thread and having good infrastructure. TPL is still wrapped around the same namespace. TPL Task can be found in the namespace Syste.Threading.Tasks. TPL task has same ability to of a Thread object and been extended.
The below code shows how a thread and a TPL task can be used in typical scenarios