How to make PLINQ to spawn more concurrent threads in .NET 4.0 beta 2?

.net, .net-4.0, .net-4.0-beta-2, parallel-extensions, plinq

Solution

In the new version you can specify it with the extension method ".WithDegreeOfParallelism(int degreeOfParallelism)".

IE:

enumerable.AsParallel().WithDegreeOfParallelism(numberOfThreads)

Problem

In former versions of Parallel Extensions you could set the number of threads: ``` enumerable.AsParallel(numberOfThreads) ``` But now that overload is not available anymore. How to do it now?

Original source