Questions tagged [interrupt]

Use for questions related to interrupt signals and interrupt handling.

In computing, an interrupt is an asynchronous signal indicating the need for attention or a synchronous event in software indicating the need for a change in execution.

A hardware interrupt happens in response to some hardware event (say mouse movement) and causes the processor to save its state of execution and begin execution of an interrupt handler. At the same time, the possibility for this interrupt is disabled (to prevent it happening repeatedly) and must be re-enabled by software after the current interrupt has been serviced.

Interrupts are usually identified by number, and normally there is a system table somewhere in the OS that maps this number to the address of function that must service the interrupt.

Software interrupts as seen by the programmer do not differ much from the usual function calls. However they are usually implemented as specific instructions in the instruction set so may require less code to be called. Software interrupts are processed in a very similar way to the way hardware interrupts are processed, often using similar context switching and a shared interrupt table for both.

3261 questions
217
votes
10 answers

What is the difference between Trap and Interrupt?

What is the difference between Trap and Interrupt? If the terminology is different for different systems, then what do they mean on x86?
David
  • 3,190
  • 8
  • 25
  • 31
130
votes
9 answers

What does "int 0x80" mean in assembly code?

Can someone explain what the following assembly code does? int 0x80
Josh Curren
  • 10,171
  • 17
  • 62
  • 73
84
votes
12 answers

What is the difference between FIQ and IRQ interrupt system?

I want to know the difference between FIQ and IRQ interrupt system in any microprocessor, e.g: ARM926EJ.
Renjith G
  • 6,307
  • 9
  • 27
  • 26
50
votes
3 answers

The difference between Call Gate, Interrupt Gate, Trap Gate?

I am studying Intel Protected Mode. I found that Call Gate, Interrupt Gate, Trap Gate are almost the same. In fact, besides that Call Gate has the fields for parameter counter, and that these 3 gates have different type fields, they are identical in…
smwikipedia
  • 61,609
  • 92
  • 309
  • 482
48
votes
4 answers

Signals and interrupts a comparison

Based on various references, my subjective definition of signals in Linux is "The triggers that are used to notify the processes about an occurrence of a specific event.Event here may refer to a software exception.Additionally signals may also be…
Vivek Maran
  • 2,623
  • 5
  • 38
  • 52
45
votes
14 answers

Polling or Interrupt based method

When should one use polling method and when should one use interrupt based method ? Are there scenarios in which both can be used ?
Karthik Balaguru
  • 7,424
  • 7
  • 48
  • 65
43
votes
6 answers

How do system calls work?

I understand that a user can own a process and each process has an address space (which contains valid memory locations, this process can reference). I know that a process can call a system call and pass parameters to it, just like any other library…
xyz
  • 8,607
  • 16
  • 66
  • 90
43
votes
3 answers

Simulating a phone call interruption in the iPhone simulator

I want to see what happens to my application if it is interrupted by a phone call or text message. Is there a way I can test this on the iPhone simulator?
Sean Smyth
  • 1,509
  • 3
  • 25
  • 43
36
votes
2 answers

What happens when an ISR is running and another interrupt happens?

What happens if an ISR is running, and another interrupt occurs? Does the first interrupt get interrupted? Will the second interrupt get ignored? Or will it fire when the first ISR is done? EDIT I forgot to include it in the question (but I included…
BenjiWiebe
  • 2,116
  • 5
  • 22
  • 41
36
votes
2 answers

Stopping C++ 11 std::threads waiting on a std::condition_variable

I am trying to understand the basic multithreading mechanisms in the new C++ 11 standard. The most basic example I can think of is the following: A producer and a consumer are implemented in separate threads The producer places a certain amount of…
Devon Cornwall
  • 957
  • 1
  • 7
  • 17
35
votes
7 answers

Is Thread.interrupt() evil?

A teammate made the following claim: "Thread.interrupt() is inherently broken, and should (almost) never be used". I am trying to understand why this is the case. Is it a known best practice never to use Thread.interrupt()? Can you provide…
ripper234
  • 222,824
  • 274
  • 634
  • 905
33
votes
2 answers

Intel x86 vs x64 system call

I'm reading about the difference in assembly between x86 and x64. On x86, the system call number is placed in eax, then int 80h is executed to generate a software interrupt. But on x64, the system call number is placed in rax, then syscall is…
becks
  • 2,656
  • 8
  • 35
  • 64
32
votes
5 answers

How to run one last function before getting killed in Python?

Is there any way to run one last command before a running Python script is stopped by being killed by some other script, keyboard interrupt etc.
dan
  • 585
  • 2
  • 6
  • 8
31
votes
2 answers

In an operating system, what is the difference between a system call and an interrupt?

In an operating system, what is the difference between a system call and an interrupt? Are all system calls interrupts? Are all interrupts system calls?
Brad Penney
  • 421
  • 1
  • 4
  • 6
30
votes
2 answers

When an interrupt occurs, what happens to instructions in the pipeline?

Assume a 5-stage pipeline architecture (IF = Instruction Fetch, ID = Instruction Decode, EX = Execute, MEM = Memory access, WB = Register write back). There are 4 instructions that has to be executed. (These sample instruction are not accurate, but…
Raghupathy
  • 823
  • 1
  • 9
  • 21
1
2 3
99 100