Channel 9 - Going Deep Stephen Toub: Inside TPL Dataflow
Why Stack Overflow recommends it
Stack Overflow users link it when asking or explaining how TPL Dataflow blocks create and schedule tasks and threads internally.
Recommended by 0 people across 0 different months, 2017 to 2020.
What it is
A Channel 9 'Going Deep' interview in which Microsoft's Stephen Toub explains the internals of TPL Dataflow (System.Threading.Tasks.Dataflow), the .NET library for dataflow-based parallel programming built on Tasks. It covers how blocks, queues and tasks work together and how the library integrates with async/await in C# and VB.
What people said
Cites Moerwald · 2017-06 · Stack Overflow · on “TPL Dataflow Block with permanent Task/Thread”
Stepen Toub mentions in this Channel 9 Video [this video] that a *Block creates a task if an item was pushed to its incoming queue. If all items in queue are computed the task gets destroyed. If I use a lot of blocks to build up a mesh to number of actually running tasks is not clear (and if the TaskScheduler is the default one the number of active ThreadPool threads is also not clear). Does TPL Dataflow offers a way where I can say: "Ok I want this kind of block with a permanent running task (thread)?
Cites TheGeneral · 2018-08 · Stack Overflow · on “Handling Parallel Jobs/Threads”
There a is a lot of misconceptions here, I'll point out just a few. To creating a counter, which way has better performance. They both do, depending on your exact situation After a lot of research I just figured out that using Parallel.ForEach has better performance This is also very suspect, and actually just wrong. Once again it depends on what you want to do. I know I can specify a MaxDegreeOfParallelism in a ParallelOptions parameter, but the problem is here, every time crawl(url) method runs, It just create another limited number of threads Once again this is wrong, this is your own implementation detail, and depends on how you do it. also TPL MaxDegreeOfParallelism is only a suggestion
Cites Theodor Zoulias · 2020-06 · Stack Overflow · on “TPL Dataflow Block with permanent Task/Thread”
The talk [this video] is about the internal machinery of the TPL Dataflow library. As a mechanism it is a quite efficient, and you shouldn't really worry about any overhead unless your intended throughput is in the order of 100,000 messages per second or more (in which case you should search for ways to chunkify your workload). Even with workloads with very small granularity, the difference between processing the messages using a single task for all messages, or a dedicated task for each one, should be hardly noticeable. A Task is an object that "weighs" normally a couple hundred bytes, and the .NET platform is able to create and recycle millions of objects of this size per second. It would be a