Essential C# Parallel LINQ PLINQ  Suggest an edit

WithDegreeOfParallelism

The degree of parallelism is the maximum number of concurrently executing tasks that will be used to process the query.

var sequence = Enumerable.Range(1, 10000);
var evenNumbers = sequence.AsParallel()
                          .WithDegreeOfParallelism(4)
                          .Where(x => x % 2 == 0);

Table Of Contents
22 Enum
25 GUID
67 Parallel LINQ PLINQ
107 Stream
108 Timers
  ↑ ↓ to navigate     ↵ to select     Esc to close