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,
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,