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 threads is 8. I assume number of task can be run in parallel is related to the cpu number of threads. I dont want to create more task than the number of threads. How do i know the number of threads in c#? I tried query ParallelOptions.MaxDegreeOfParallelism and all i get is -1.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
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.