question

TZacks-2728 avatar image
0 Votes"
TZacks-2728 asked DanielZhang-MSFT edited

Few good usages of TPL Data flow

I have never use TPL data flow and just hear people use to create their own pipe line. i want to read some good beginner like article for TPL data flow. i search google but their code and explanation not TPL data flow beginner. it has many blocks. i want to understand each block with detail usages. i want to understand when to use which block ?

TPL data flow always start a background thread ?

if possible please explain each block of TPL data flow with example and also please shared few good article links which help some one to understand and use TPL data flow in their daily coding. thanks

dotnet-csharp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DanielZhang-MSFT avatar image
0 Votes"
DanielZhang-MSFT answered DanielZhang-MSFT edited

Hi TZacks-2728
The TPL Dataflow Library consists of dataflow blocks, which are data structures that buffer and process data. The TPL defines three kinds of dataflow blocks: source blocks, target blocks, and propagator blocks. A source block acts as a source of data and can be read from. A target block acts as a receiver of data and can be written to. A propagator block acts as both a source block and a target block, and can be read from and written to.
Each dataflow block has an associated System.Threading.Tasks.Task object, known as a completion task, that represents the completion status of the block. Because you can wait for a Task object to finish, by using completion tasks, you can wait for one or more terminal nodes of a dataflow network to finish.
By default, tasks will use the thread pool. Threads created through the thread pool default to background threads.
In this document,each block is introduced in detail.
And there is more introduction and use of Dataflow in the table of contents on the left side of the document.
Best Regards,
Daniel Zhang


If the response is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.