1
$\begingroup$

If there is an interrupt from every keypress (or one for keydown, one for keyup, one for keypress?) how does the OS handle so many interrupts at the same time. A person typing at 120WPM would be sending more than 500 interrupts per minute. How does a process ever finish if there is a context switch for the CPU to handle the interrupt 500 times per minute.

I must be missing something here?

$\endgroup$
  • 1
    $\begingroup$ Computers are pretty fast, you know... Note, by the way, that IRQ 0 actually happens a lot more often than. $\endgroup$ – Karolis Juodelė Apr 14 '13 at 7:03
  • $\begingroup$ Adding some numbers to @KarolisJuodelė 's comment: a 2.4GHz cpu completes 2,400,000,000 cycles per second. If you typed fast enough for the cpu to drop interrupts, your keyboard and bones would melt... And as the comment above mentions, there are much more frequent interrupts (e.g. ethernet, mouse movement, and internal context switches). $\endgroup$ – Shaull Apr 14 '13 at 8:04
  • $\begingroup$ wow, we need to give 2,400,000,000+1 keystrokes to CPU to drop interrupts. Amazing. $\endgroup$ – avi Apr 14 '13 at 9:36
  • $\begingroup$ I struggle to see a CS question here. $\endgroup$ – Raphael Apr 14 '13 at 11:40
2
$\begingroup$

A modern computer is designed to handle many more interrupts than you could possibly generate with your keyboard.

You should expect interrupts to range upward from 1,000 per second for computers running Windows 2000 Server

See this link.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.