My system's configuration is this: Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz, 2694 Mhz, 4 Core(s), 8 Logical Processor(s)
You may notice that my machine has 4 cores and 8 logical processors.
If I'm going to use a PLINQ query to take advantage of the parallelism, can I specify 7 for the WithDegreeOfParallelism so the query will take advantage of all the logical processors by creating one thread for each logical processor?
PLINQ
how many logical processors you have. It already knows (usingEnvironment.ProcessorCount
), and it will optimize the query accordingly. The intention ofWithDegreeOfParallelism
is to control whatPLINQ
doesn't know, for example if your code is mainlyI/O
intensive and notCPU
intensive.