The main function in an Interrupt of a Computer

  • Thread starter Thread starter Cruger
  • Start date Start date
  • Tags Tags
    Computer Function
Click For Summary

Discussion Overview

The discussion centers on the main function of interrupts in operating systems, exploring how interrupts operate, their handling, and the comparison between interrupt-driven input and polling methods. The scope includes technical explanations and conceptual clarifications related to operating system design and microprocessor functionality.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • Some participants describe interrupts as signals generated by hardware that cause the operating system to pause the currently executing thread and save its state, with the interrupt handler managing this process.
  • Others explain that there are two primary methods for input handling in microprocessors: interrupt-driven input and polling, with the former allowing hardware signals to interrupt the OS and the latter involving a continuous loop checking input states.
  • A participant notes that polling is rarely used but can be necessary in specific contexts, such as telecom applications, to ensure timely handling of data without interruptions.
  • One participant uses an analogy of a classroom to illustrate the differences between interrupt-driven systems and polling, suggesting that interrupts can lead to unequal opportunities for processing inputs based on priority.

Areas of Agreement / Disagreement

Participants express various viewpoints on the effectiveness and application of interrupts versus polling, indicating that multiple competing views remain without a clear consensus on the best approach for handling inputs in operating systems.

Contextual Notes

The discussion includes assumptions about the familiarity with operating system concepts and microprocessor functionality, as well as the implications of prioritizing interrupts over polling methods, which remain unresolved.

Cruger
Messages
7
Reaction score
0
Hi there,
Can somebody explain me the main function in Interrupt in the operating System?
 
Technology news on Phys.org
An interrupt (like from a driver) generates an OS signal. The currently executing thread is interrupted, and the program state (registers, usermode stacks, and program pointer) are saved - usually to the interrupt stack.

The function doing this is called an interrupt handler.[/color] These guys live in microcontroller firmware, device drivers, and parts of the OS kernel.
 
  • Like
Likes   Reactions: 1 person
There are two classic ways for microprocessors/processors/CPU's to receive input. One is to allow hardware signals to "interrupt" the operating system, which causes execution to jump over to an "interrupt subroutine" for a bit, then return to the operating system. The interrupt subroutine will probably be placing input characters in a buffer, or some similar thing.

The alternatively to interrupt-driven inputs is polling. With a microprocessor, it may be possible to "turn off" most interrupts, and instead, the operating system can be programmed differently, so that it runs a loop which periodically polls each input pin to see it's state. In a polling situation, the logic that was in the interrupt service routine is now right inside the OS and executes right after the polling of that pin.

Polling is rarely used. We had to use it in telecom, sometimes, when handling really fast bit streams in fiber optics communications. That's because we had to make sure that nothing could "interrupt" the timely handling of bit pushing. The risk of an interrupt-driven system is that interrupts are prioritized, so if a high-priority interrupt happens too frequently, the lower-priority interrupts will never execute. Polling allows a way to guarantee that all input pins will be treated with approximately the same priority, simply by making sure that whatever is done at each pin does not take to long before you go on to the next pin.

So...think of a classroom where anyone is allowed to speak. Some people will interrupt a lot, and quieter folks will get little chance to say anything. Then think of a round-robin situation, where everyone is given a chance to speak (for say, a maximum time of one minute). It is easy to understand in that kind of scenario, but in my experience, students have had trouble grasping the difference in microprocessors.
 
Last edited:
  • Like
Likes   Reactions: 1 person

Similar threads

Replies
19
Views
3K
Replies
6
Views
4K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 8 ·
Replies
8
Views
6K