How to get maximum degree of parallelism for task parallel library usage?

前端 未结 1 1002
广开言路
广开言路 2021-01-05 14:24

I want to use Parallel.invoke. If i assign 20 parallel task, only 8 of then are run concurrently. My CPU is http://ark.intel.com/products/47925 and the reported number of th

相关标签:
1条回答
  • 2021-01-05 15:25

    Parallel tasks are basically threads that can be shared. Because the number of active threads is limited by the number of logical processor cores that are available, a good guess would be to just take the number of logical cores available to the program.

    Environment.ProcessorCount
    
    0 讨论(0)
提交回复
热议问题