Few good usages of TPL Data flow

T.Zacks 3,986 Reputation points
2021-04-02T19:21:54.333+00:00

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

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,247 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,611 Reputation points
    2021-04-05T07:05:12.63+00:00

    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.

    0 comments No comments