title: How does a CPU idle (or run below 100%)?
body: <p>I first learned about how computers work in terms of a primitive single stored program machine.</p>
  
  <p>Now I'm learning about multitasking operating systems, scheduling, context switching, etc.  I think I have a fairly good grasp of it all, except for one thing.  I have always thought of a CPU as something which is just charging forward non-stop.  It always knows where to go next (program counter), and it goes to that instruction, etc, ad infinitum.</p>
  
  <p>Clearly this is not the case since my desktop computer CPU is not always running at 100%.  So how does the CPU shut itself off or throttle itself down, and what role does the OS play in this?  I'm guessing there's an input on the CPU somewhere which allows it to power down... and the OS can set this if it has nothing to schedule, but the next logical question is how does it start back up again?  I'm guessing either one of two things:</p>
  
  <ul>
  <li>It never shuts down completely, just runs at a very low frequency waiting for the scheduler to get busy again</li>
  <li>It shuts down completely but is woken up by interrupts</li>
  </ul>
  
  <p>I searched all over for info on this and came up fairly empty-handed.  Any insight would be much appreciated.</p>