What are the differences between Interrupts and Exceptions ?


  • 0
    T

    How they differs each other on the grounds of process executions, etc ?


  • 1
    T
    • Exception condition refers to unexpected events caused by a process, such as addressing illegal memory, executing privileged instructions, divide by zero etc. While interrupts are caused by the events that are external to process.

    • Exception happens "in the middle of execution" of an instruction, and system attempts to restart the instruction after handling the instruction, while interrupts are considered to happen between the execution of two instructions, and system continues with the next instruction after servicing the interrupt.


  • 0
    N

    Interrupts are Hardware interrupts, while exceptions are software interrupts. Occurrences of hardware interrupts usually disable other hardware interrupts, but this is not true for exceptions. If you need to disallow hardware interrupts until an exception is served, you need to explicitly clear the interrupt flag. And usually the interrupt flag on the computer affects (hardware) interrupts as opposed to exceptions. This means that clearing this flag will not prevent exceptions.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.