1

When a CPU "multitasks" it is rapidly switching between the threads of various processes to simulate processing which looks like true parallel.

When you have too many interrupts while running a program, you may not notice a difference in the performance of that program since it would only require a thread when processing, therefore letting the CPU idle when the program's not actively doing something.

What about the case of audio? Suppose we're talking about MP3 decompression. The CPU would decompress the MP3 and stream at some bitrate to the DAC. Since the CPU is still switching between threads constantly while decompressing the MP3, what happens if there are too many interrupts while an audio file is playing? How is it possible that I can listen to an audio file completely uninterrupted while there may be other performance-heavy tasks running, nearly freezing the computer?

Kunal Chopra
  • 219
  • 3
  • 8
  • 2
    Common audio is played at 44100 Hz. About 90000 slower that the cycle of a modern CPU. This is to get the idea. Note that the audio is *buffered*, the CPU need to produce just about 172 KiB of data each second. Further, the OS usually has support for multimedia operations, including giving priority to processes playing media and with a buffer soon to be exhausted. Finally, if you actually put the OS under very heavy stress you can hear the audio lag. – Margaret Bloom Nov 28 '16 at 10:50

0 Answers0