Thanks for the quick improvement. As for the "Logical Processor" vs. "CPU Core" terms, I agree, from the point of view of marketing, you are right, but from the point of view of "technically correct", both are useful. For example, in Win7 MSINFO32, I see this on my PC:
Processor Intel(R) Xeon(R) CPU X5482 @ 3.20GHz, 3192 Mhz, 4 Core(s), 4 Logical Processor(s)
Processor Intel(R) Xeon(R) CPU X5482 @ 3.20GHz, 3192 Mhz, 4 Core(s), 4 Logical Processor(s)
Even Microsoft improved their tool to show reality. I found out how to programmatically get the number of cores vs. logical processors. Take a look at this open source project:
http://code.google.com/p/geekinfo/When you get it to compile, it can extract both of these. The Windows API for SetAffinity() only thinks in "Logicla Processor" terms. The best improvement you could make to the software is to list the cores, then list a subset of logical processors for each core when the Logical Processor count is larger than the Core count. The trick I do not know yet is if the Logical Processor count, for example is 8, and the Core count is 4, I think this is true, but I never did research to check:
SetAffinity() to Logical Processor Index 0 is to Core 1, HyperThread Core 1.
SetAffinity() to Logical Processor Index 1 is to Core 1, HyperThread Core 2.
SetAffinity() to Logical Processor Index 2 is to Core 2, HyperThread Core 1.
SetAffinity() to Logical Processor Index 3 is to Core 2, HyperThread Core 2..
SetAffinity() to Logical Processor Index 4 is to Core 3, HyperThread Core 1.
SetAffinity() to Logical Processor Index 5 is to Core 3, HyperThread Core 2.
SetAffinity() to Logical Processor Index 6 is to Core 4, HyperThread Core 1.
SetAffinity() to Logical Processor Index 7 is to Core 4, HyperThread Core 2.
Anyway, just a suggestion for further improvements. For now, what you made is good for me.
