This will process the elements at the same time.
Parallel.ForEach(CurrentFeed.Items, DoSomethingAsync)
To be able to cancel, you may need a CancellationToken.
CancellationTokenSource cts = new CancellationTokenSource(); ParallelOptions po = new ParallelOptions(); po.CancellationToken = cts.Token; // Add the ParallelOptions with the token to the ForEach call Parallel.ForEach(CurrentFeed.Items,po ,DoSomethingAsync) // set cancel on the token somewhere in the workers to make the loop stop cts.Cancel();
For more details see (among other sources) http://msdn.microsoft.com/en-us/library/ee256691.aspx
source share