title: What happens if when a system call is being executed, the hardware timer interrupt fires?
body: <p>Say we have one CPU with only one core, and there are many threads that are running on this core.</p>
  
  <p>Let's say that <strong>Thread A</strong> has issued a system call, now the interrupt handler for the system call will be executed.</p>
  
  <p>Now while the the system call is being executed, say that the hardware timer interrupt (the one responsible for the scheduling of threads) fires. What will happen in this case, will the CPU stop running the system call and go to execute the scheduler code, or does the CPU must wait for the system call to be fully executed before switching to another thread?</p>