WithDegreeOfParallelism
suggest changeThe 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);
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents