GSoC 2011 - TPL Dataflow
This summer I have been working again as a Google Summer of Code student for Mono. This time, I re-implemented another parallel-related library called TPL Dataflow.
It’s still a research project at Microsoft and it has recently released a preview version of the framework which is designed to work well with the asynchronous features of the latest .NET CTP.
The goal of the framework is similar to PLinq in the sense that you construct a pipeline composed of blocks expressing individual operation (action, transformation, join, fork, …) with the notable difference that the model is push-based instead of pull-based.
Push-based basically means that, in the same way than the Reactive Extensions, you explicitly feed data to your pipeline instead of acquiring it from a source. Then the final data can be received or processed by a block at the other end of the chain.
All of that makes a nice model for asynchronicity that you can use both to send or receive data thanks to a number of extensions method in the framework (suffixed by
Async) which returns a
Task thus letting you setup continuations or use the new
await keyword (also available in Mono master btw).
Under the hood the framework is built upon what ParallelFx provides like the concurrent collections and the task primitive meaning it’s also taking full advantage of the available parallelism on your machine.
The code is now available directly from Mono master and is built in the
System.Threading.Tasks.Dataflow assembly with the 4.0 profile. While not totally complete, it’s still already usable.
MSDN doesn’t yet show the documentation so I uploaded the copy shipped with the preview.
You can also watch Stephen Toub introductory video for a tour of the framework (also embedded below).