Interrupt Vs System Call

  • 3

    User programs can’t be trusted if they wish to invoke some functionality in kernel. So whenever they wish to access the OS functionality in kernel they make the use of System Calls. System Calls let the User access the kernel in controlled manner.

    However an interrupt is a request from some external device for a response from the processor. There can be software interrupts (generated via a program) or hardware interrupts but the way interrupts are handled remains same.

  • 1

    System call is a call to a subroutine built in to the system, while Interrupt is an event, which causes the processor to temporarily hold the current execution. However one major difference is that system calls are synchronous, whereas interrupts are not. That means system calls occur at a fixed time (usually determined by the programmer), but interrupts can occur at any time due an unexpected event such as a key press on the keyboard by the user. Therefore, when ever a system call occurs the processor only has to remember where to return to, but in the event of an interrupt, the processor has to remember both the place to return to and the state of the system. Unlike a system call, an interrupt usually does not have anything to do with the current program.

Log in to reply

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