Can the .NET thread-pool take advantage of Multiple-CPUs and not just Multiple-cores CPU?
I am writing a program that benefits greatly from running multiple processes in parallel. I have tested it on our i7 CPU which has 4 cores and I see big speed-ups over a single 2 core machine.
The application is now being deployed and the local IT people a开发者_如何学编程re considering putting together a machine that has 2 CPUs with 4 cores each. This is a .NET 4 application. Do you think I would essentially be able to use 8 processors or only 4 ?
Thank you.
It should transparently use all processors/cores available, if using the parallel extensions and not limiting the number of processors in config.
The framework doesn't differentiate between multi-core CPUs and physical CPUs.
Eight. Each core is a logical processor. The framework doesn't much know whether you have a single eight-core processor or dual four-core processors.
You did not mention which specific Core i7 chip you are using but afaik core i7 are there with Dual socket models in which case it is actually two dual-core processors making it a total number of 4 cores. Yes, any implementation that is written using .Net framework can use all of the available cores (even hyper threading) as that is controlled by OS automatically (unless and until your application specifies how the cores are pinned to the CPUs and it uses cpu mask based on physical id of the processor).
Isn't the only difference being the physical location of the CPU - that they're on the same slice of silicon?
It might differentiate if it's using hyperthreading (where a four-core cpu has hyperthreading, and thus exposes 8 "cpu"'s), but even then I doubt it, the framework will probably just see 8 CPU's.
A dual-quad-core system with hyperthreading, would therefore potentially expose 16 CPU's.
精彩评论