3) What is an Interrupt? What is the advantage of using Interrupts in a computer system?
1 Answer

Interrupts :-

  • Interrupts are a response by the processor to a process/event that needs immediate attention from the software.

  • Interrupts alert the processor and servers a a request for the CPU to interrupt the currently executing program/code when permitted, in order so that the event can be processed within good time.

  • If the response is accepted from the processor, the processor will respond by suspending its current activities (saving its state), and thus executing a function called an interrupt handler to deal with the event.

  • This interrupt in activities and programs is only temporary, that is, unless the interrupt indicates a fatal error, otherwise the processor will resume all normal running actives after the interrupt handler finishes.

  • Interrupts are used by both hardware and software to indicate electric or physical state changes that require attention.

  • Interrupts have a heavy usage in computer multi-tasking, especially in real-time computing, moreover, these systems that utilise interrupts are said to be “interrupt-driven”.''

Advantages of Interrupts :-

  • Interrupts enable context switching. In a multi-processor computer, interrupts give the impression that the computer is multitasking.

  • In actuality, what happens is a lot of processes each with assigned priority levels are swapped in and out of memory to achieve the multitasking effect.

  • Interrupts are signals that tell the CPU when to stop it's current process to attend to a higher priority one.

  • One of the advantages of interrupts is that they can be used to break an infinite loop, which can create memory leaks or cause a program to be unresponsive.

  • Interrupts are important because they give the user better control over the computer.

  • Without interrupts, a user may have to wait for a given application to have a higher priority over the CPU to be ran. This ensures that the CPU will deal with the process immediately.

Please log in to add an answer.