Issues with Processor Information After Hot-Plugging Cores

晨东 孙 0 Reputation points
2024-06-26T08:33:09.01+00:00

The program retrieves CPU utilization through the "Processor Information" counter. However, if the program is running and additional CPU cores are hot-plugged, it cannot access data from the newly added CPUs. A process restart is required to obtain all CPU data correctly

Windows Driver Kit (WDK)
Windows Driver Kit (WDK)
A set of Microsoft tools that are used to develop, test, and deploy Windows drivers.
46 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. josh morrish 0 Reputation points
    2024-06-27T03:42:13.89+00:00

    This behavior is expected due to the way most operating systems and performance monitoring tools work. When a program starts, it typically initializes its performance counters based on the current system configuration, including the number of CPU cores. If additional cores are hot-plugged while the program is running, the program may not be aware of these new cores, and thus, it can’t monitor them.

    Restarting the program allows it to re-initialize its performance counters and detect the newly added cores. This is why a process restart is required to obtain all CPU data correctly after hot-plugging additional cores.

    If you need to frequently hot-plug CPU cores and want your program to automatically detect them, you might need to modify your program to periodically re-initialize its performance counters, or use an operating system feature or a third-party library that supports dynamic CPU core detection. However, this could be complex and might not be supported on all platforms.

    0 comments No comments