April 2018
Intermediate to advanced
300 pages
7h 41m
English
The dataflow pattern is a generalized pattern with a one-to-many and a many-to-one relationship. For example, the following diagram represents two tasks, Task 1 and Task 2, that execute in parallel, and a third task, Task 3, that will only start when both of the first two tasks are completed. Once Task 3 is completed, Task 4 and Task 5 will be executed in parallel:

We can implement the preceding example using the following code:
static void Main(string[] args)
{ //Creating two tasks t1 and t2 and starting them at the same //time Task<int> t1 = Task.Factory.StartNew(() => { return Task1(); }); Task<int> t2 = Task.Factory.StartNew(() ...Read now
Unlock full access