How many threads Parallel.For(Foreach) will create? Default MaxDegreeOfParallelism?
问题 I want to know, how many threads will be used when I run Parallel.For/ForEach loop. I found, that it can be changed by MaxDegreeOfParallelism option. MaxDegreeOfParallelism help on MSDN says (link): By default, For and ForEach will utilize however many threads the underlying scheduler provides, so changing MaxDegreeOfParallelism from the default only limits how many concurrent tasks will be used. But I don't know how many threads underlying scheduler provides. How can I find out that? I could