I need to restore vm groups in parallel, for which I'm using a parallel foreach loop. I also want to use MaxDegreeOfParallelism
to limit the number of threads. Since mine is a CPU bound operation, I believe the maximum number of threads should equal the number of cores.
Does the number of threads depend on the actual number of cores or also on the number of logical processors? Are there any other factors that this number could depend on? Is there a way other than trial-and-error to test this?
Also, is this the relation between logical processors and actual cores:
(# of logical processors) = (# of cores) * (# of threads per core)