How CPU usage is Calculating ? RRS feed

  • Question

  • How Kernel mode Driver or OS doing the following task ? 

    #2 >> and even internal FAN control. How it's done ? from lower level ? 

    • Edited by Dr. Bean Sunday, June 26, 2016 4:17 PM
    Sunday, June 26, 2016 4:13 PM

All replies

  • CPU usage is based on the percentage of time a particular process is running.   Windows has a system idle process that is there to indicate idle time.  So basically the scheduler records the interval of time between an event that causes a process to run and the event that causes another process to run.

    Don Burn Windows Driver Consulting Website:

    Sunday, June 26, 2016 9:48 PM
  • If you can explain why you need to know then you are more likely to get a better answer.

    There are at least two kinds of processor time. Sometimes the amount of time spent by the operating system for an application is included and sometimes it is not. To understand how it is done, you need to understand about tasks and processes. Windows gives control (of a processor core or whatever) to a task and then the task either finishes, or asks Windows to do something or some other event interrupts the task. As I said, all of that is explained in books and articles about operating systems. The important thing is that Windows keeps track of what the clock is for all of those things and is then able to determine how much time is spent for everything.

    The idle time is the time spent doing nothing else. I think, but I am not sure, that the processor is put into a special state during idle time that reduces the circuitry used and that uses less power. For desktop processors less power does not matter but it reduces the amount of heat generated.

    As for the fan (and some other things like processor temperature), that is totally different. That depends on the system board (most people call them motherboards but IBM and I call them system boards). Each manufacturer (and potentially every model) can vary. Windows needs code specific to the system board. Note that there is a new kind of BIOS called UEFI and it probably has a standard way of monitoring things like fans and temperature.

    Sam Hobbs

    Monday, June 27, 2016 12:27 AM