Throttled Parallel ForEach

The ThrottleParallelForEach activity is similar to the ParallelForEach<T> activity with the one exception that it allows setting a concurrency factor to restrict the number of simultaneous branches to execute. The ThrottleParallelForEach activity derives from NativeActivity, because it needs to schedule other activities (the child activities) and this is only accessible through the NativeActivityContext class.


ProjectName Description Main Files
ThrottledParallelForEach Contains ThrottledParallelForEach activity and its designer. ThrottledParallelForEach.cs

The ThrottledParallelForEach activity definition.
CodeTestClient Sample client application that configures and runs a workflow with a ThrottledParallelForEach using imperative code. Program.cs

Defines and runs an instance of the sample workflow.

To use this sample

  1. Using Visual Studio 2010, open the ThrottledParallelForEach.sln file.

  2. To build the solution, press CTRL+SHIFT+B.

  3. To run the solution, press F5.


The samples may already be installed on your machine. Check for the following (default) directory before continuing.


If this directory does not exist, go to Windows Communication Foundation (WCF) and Windows Workflow Foundation (WF) Samples for .NET Framework 4 to download all Windows Communication Foundation (WCF) and WF samples. This sample is located in the following directory.