The OS is probably much better at determining which kernel to use. People at MS have spent a lot of time optimizing this particular aspect.
If you try to make this decision, will you support this for every new service pack, OS version, hardware taste, etc.?
It is best to spend some time optimizing processes without trying to get ahead of the OS.
UPDATE:
With performance counters, itβs not as easy as grabbing the first value you find. You need to poll at least two times (with a certain period of time) to get the value.
Itβs not necessary how I will implement it in a real-world scenario, but here is the idea:
var coreUsages = new PerformanceCounter[Environment.ProcessorCount]; for (var i = 0; i < coreUsages.Length; i++) { coreUsages[i] = new PerformanceCounter("Processor", "% Processor Time", i.ToString()); coreUsages[i].NextValue(); } Thread.Sleep(1000); for (var i = 0; i < coreUsages.Length; i++) {
Rqdq source share