Only one CPU being utilized

Symptom:
========
You have several threads in your application running , but you observe that only One CPU Core is being utilized by all of your threads and you don't see any activity on the other CPU Cores.
Questions:
========

Why do I don't see any activity on the other CPU cores? Why the other CPU Cores are sitting idle? Is this a problem? Is there a way to make my threads spread across all the CPU
cores so that my application performs much better?

Resolution:
========

Generally, having an application interfere with the scheduler’s decisions by forcing threads onto different CPUs leads to worse overall behavior, not better. Generally, if the threads within a single process aren’t fully utilizing a processor, it’s best to keep them all on the same CPU because this increases the overall performance by reducing the overhead of address translation when threads touch memory. Basically, the CPUs have registers called Translation Lookaside Buffers (TLBs) which cache page tables for processes. When the threads from the same process run on the same CPU, then the TLB registers don’t have to be reloaded .This saves a lot of clock cycles. There is a threshold where below a certain CPU utilization, it’s faster to run the threads on the same core, and above which it’s better to run them on multiple cores. The scheduler tries to find this balance, but it does so taking into account all threads from all processes on the system.

Also Starting from Windows Server 2008 R2, systems which have low CPU utilization will use "core parking" to conserve energy. Basically, if the system has multiple cores, but only one is needed to handle the workload (as measured by utilization), the others can be powered down to save energy. They will then be powered up automatically when the workload increases so it’s very dynamic.

Some suggestions which may help here are:

a) Does your application faces any performance issue because of only one CPU being utilized heavily?

b) Is the processor completely saturated  (i.e) Does the one processor always at nearly 100% utilization and still your Application is running slow?

If the answer to the above two questions are YES, then you  need to isolate the specific component in your application [ Which API or a set of API's is causing this behavior?]  and fix them.

Balajee P
Windows SDK.