Thursday, August 16, 2018

Signal vs Interrupt

Interrupts are for external events.
When an interrupt occurs , a context switch of already running thread is done to handle that interrupt.
Interrupts are handled by CPU for hardware events.
On receiving interrupt CPU does context switch i.e. saves the state of registers and starts processing the interrupt. (eg: keyboard input).

eg:
Keyboard input
I/O processing
high priority interrupt : NMI


Signals are more of internal mechanism to handle different events.
When a signal is sent to a process then OS interrupts the normal process flow control and handles that signal, if process has its own instructions to handle signal, else OS follows default signal handling. Signals are for process or threads and interrupts are for hardware/external events.

eg: SIGHUP, SIGTERM, 

1 comment:

  1. How to Win at Bet365 – What is it and How is it Different From
    Bet365 is one of the largest betting 1xbet sites in the world and is owned 바카라 사이트 by the Pinnacle Group. Their 온카지노 headquarters are the largest in the world and is

    ReplyDelete