0

My understanding on the both are slightly unclear. Many people on the internet say they are both the same. There are a few questions similar to my one, however none of them give a good real life example at a software level.

Would it be possible for someone to give me a clear example of both which will help me understand the differences between one another?

For example, is a division by zero a software interrupt? Or an exception?

user3054735
  • 117
  • 1
  • 2
  • 8

1 Answers1

0

Interrupt and exceptions have the same method of dispatch (usually through the system interrupt vector). However, interrupts and exceptions are triggered differently.

An exception occurs through the execution of the instruction stream. Thus, exceptions occur at predictable points in an application.

Interrupts occur as the result of events external to the execution stream.

Division by zero is occurs as the result of the instruction stream making it an exception.

Some operating systems are interrupt-based (e.g., Windoze and VMS).They allow the application to be interrupted in user (or other modes) for various reasons.

For example. in both those operating systems you can queue I/O operation and then have the application be interrupted when the I/O completes (a software interrupt triggered by the operating system rather than the hardware).

user3344003
  • 20,574
  • 3
  • 26
  • 62