开发者

detect how many cores a client has using C#

I am creating a program that will multiple background tasks simultaneously. I would like to create a numbe开发者_开发问答r of threads to do these based on the number of cores that a client is running. So that if they are using a multi-core processor, the program will run faster. Is there any way to have C# check how many cores a processor has? Finding model of the processor would also work.


You could use Environment.ProcessorCount, although I would avoid this sort of optimization because the Task Parallel Library takes care of it for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜