File size

File size

File size

File size

File size

340.6 MB

TPL Dataflow (TDF), System.Threading.Tasks.Dataflow, builds upon the foundational layer for asynchronous and concurrent programming using Tasks provided in TPL in .NET 4. TDF is a complementary set of primitives to those delivered in TPL in .NET 4, addressing additional scenarios beyond those directly and easily supported by the original APIs. TPL Dataflow utilizes tasks, concurrent collections, tuples, and other features introduced in .NET 4 to bring support for parallel dataflow-based programming into the .NET Framework. It also directly integrates with new language support for tasks and asynchrony provided by both C# and Visual Basic, and with existing language support in .NET 4 for tasks provided by F#.

Several of you probably wonder how TDF differs from Rx in terms of core capabilities and specific usage scenarios. Well, Stephen talks about this right here.

As usual, Stephen goes deep and clearly articulates many technical details of TDF. Another great Toub session!

We will explore what's new in the Framework for parallel programming in 4.5. Specifically, we'll dive into the new TPL Dataflow library and the various improvements around partitioning, cancellation, etc.

Great video! I was curious how you'd project out of a block a type different then the input type and was pleased to see it in the last ten minutes. I'm very interested to see the relationship be Dataflow and Rx develop.

thanks for the clarification about the relationship with rx i havent watched the whole video yet but it just struck me when you where talking about the coordination stuff in the beginning, TDF also feels a bit like the CCR.. its been a while since we saw George chrysanthakopoulos on c9

more TDF screencasts would also be awsome Perhaps custom TaskSchedulers based on TDF? seems like a very good fit

i knew it.... ron jacobs aaalmost slipped the name 4.5 in his wf talk at pdc hopefully that will include that xaml editor goodness they showed for silverlight [assuming its linked to a vs service pack]

Good eye. TPL Dataflow is in part based on and inspired by concepts from CCR, along with concepts from Axum and Visual C++ 10's Asynchronous Agents library, so you'll see a lot of similarities in terms of the kinds of problems you can solve. The APIs were redesigned to fit in well with the rest of the .NET Framework and to take advantage of what the Task Parallel Library and other .NET goodies have to offer, as well as redesigned to incorporate some more scenarios and patterns we felt were important.

Regarding TaskSchedulers, sure, we'll see what we can pull together. Note that these dataflow blocks can be targetted to run on any TaskScheduler instance, so you could configure a block to run on the thread pool, or on the UI, or in a concurrent/exclusive fashion, or whatever underlying semantics you want to achieve by plugging in a custom scheduler. It sounds like you're interested in and asking about the other direction, implementing a TaskScheduler with a dataflow block (like ActionBlock)... you could certainly do that, too.

I'd love to see another video on this stuff. One that focusus on how you solve specific problems using TDF would be best. Like Rx, it seems like good stuff, but knowning when to use it isn't always obvious.

its great to see elements of the CCR getting pulled closer to the framework, i always felt the ccr got underrated or otherwise didnt enter the developer mainstream.

you're right, i was referring to implementing TaskSchedulers using TDF, maybe like a throttling ui scheduler that ensures the ui thread doesnt get flooded with updates. Just a simple scheduler that process one task at the time [just an actionblock basically] is a good practical sample too i think. Really, all the custom schedulers in the parallel programming samples are good candidates

I am curious as to why the blocks in the dataflow library are mutable. In a recent project, we designed a dataflow library in .net for processing energy usage data. Early on we decided to make the dataflow graph objects (blocks) immutable. In this library, the enumerators used to get data out of the dataflow graph are mutable. Enumerators are created on demand by block nodes when you begin to iterate over the dataflow graph (the enumerators form a parallel type of graph).Immutable block objects had advantages. We could share them between threads, and we could share blocks as input components in multiple larger graphs. By computing an immutable hash code on a block on construction, using the hash code of input blocks in the computation, we could compare block graphs for equality, and use them as keys in dictionaries that memoized graph outputs (as long as inputs were immutable, which was the case for historical data).In the TPL Dataflow library, blocks are both graph nodes and enumerators.

Remove this comment

Remove this thread

Comments Closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums, or
Contact Us and let us know.