TPL Dataflow on TC Labs

TPL Dataflow on TC Labs

  • Comments 9

After releasing a CTP of TPL Dataflow as part of the Async CTP, we had multiple requests for a standalone download for just the System.Threading.Tasks.Dataflow.dll.  Thanks to everyone who asked for this, and as of this morning, such an installer for an updated version of the preview is now available!  This is part of a special section on the MSDN DevLabs portal, focusing on projects emerging from the Technical Computing Initiative (of which TPL Dataflow is one).  You can now find a dedicated page for TPL Dataflow, along with a dedicated forum. More information and background is available at Somasegar's Weblog.

Enjoy, and keep the feedback coming.  We love hearing from you about your needs and experiences with the library, whether it be praise or criticism or just plain curiosity.

Leave a Comment
  • Please add 8 and 3 and type the answer here:
  • Post
  • Is it the same version as in Async CTP or a litttle bit updated ??

  • Hi guest-

    It's been updated, primarily with bug fixes, but also a few API updates, a few new features, and some performance work.  There's still much more to come, and the idea is that we'll be able to provide more frequent updates now that there's a separate installer/download just for this DLL.

    Some of the new features in this release include bounding support on BufferBlock (so that you can easily implement throttling) and the ability to manually trigger a batch with BatchBlock (using the TriggerBatch method), so that you can release batches based on a timer, or based on signals from another block, or whatever mechanism you choose.

  • Is there a way to control how many threads will execute the work like OpenMP has done in C++? thanks.

  • I'm using C#

  • Hi Marcus-

    Yes, there are several ways.  Per block, you can configure a MaxDegreeOfParallelism (which by default is 1), e.g.

    var ab = new ActionBlock<int>(i =>


       // .. processing here

    }, new DataflowBlockOptions(TaskScheduler.Default, 5)); // at most 5 threads at a time

    You can also create a ConcurrentExclusiveSchedulerPair instance, which provides a pair of TaskSchedulers governed by a concurrency level setting passed to the CESP's constructor, and then you can pass the relevant scheduler to all blocks you want to participate in the same maximum.

    If you're comparing with OpenMP, though, you're likely more interested in Parallel.For, which also has the ability to set a maximum degree of parallelism, e.g.

    ParallelOptions options = new ParallelOptions { MaxDegreeOfParallelism = 5 };

    Parallel.For(0, 10000, options, i=>


       // .. processing here


    I hope that helps.

  • Do I need to have VS Async CTP to use TPL Data flow?

  • Hi Joy-

    Yes.  You can install TPL Dataflow from the MSI on the TC Labs site, and you do not need to install the Async CTP to use it (though certain dataflow features are designed to integrate well with the async language support and will be easier to use when those language features are available to you).

  • I can see "CTP" everywhere, did i miss the RTM build ? or will it be rtm until C# 5 (i mean until the "embed" release of async in VS)

    It's quite hard to convince someone to use it because of the "CTP" tag, even if it's a lot easier.

  • Hi Alex-

    The TPL Dataflow library is still at CTP status.  However, the license associate with does permit various kinds of production usage.  I understand your hesitancies, of course.

Page 1 of 1 (9 items)