What is the Difference Between Signal and Interrupt

The main difference between signal and interrupt is that signal is an event that is triggered by the CPU or the software that runs on the CPU while an interrupt is an event that is triggered by an external component other than the CPU.

A signal is an event triggered by the CPU. It sends these signals to various processes that run on the computer. On the other hand, an interrupt is an event that occurs due to an external component such as timers to notify the CPU to perform a certain action.

Key Areas Covered

1. What is Signal
     – Definition, Functionality
2. What is Interrupt
     – Definition, Functionality
3. What are the Similarities Between Signal and Interrupt
     – Outline of Common Features
4. What is the Difference Between Signal and Interrupt
     – Comparison of Key Differences

Key Terms

CPU, Interrupt, Signal

Difference Between Signal and Interrupt - Comparison Summary

What is Signal

A signal is an event triggered by the CPU. It can be an interrupt caused by the software running on the CPU. This is called a software interrupt. It can also be CPU hardware itself that triggers certain events. Moreover, signals are based on the operating system. Therefore, two systems with different operating systems will generate different signals.

Difference Between Signal and Interrupt

Furthermore, there are synchronous signals as well as asynchronous signals. Synchronous signals occur in response to a specific action that occurred and the CPU will respond to that action. On the other hand, in asynchronous signals, there is no direct response to a specific action that occurred.

What is Interrupt

An interrupt is an event that occurs externally by components other than the CPU. It notifies the CPU about some kind of an external event. An IO device such as a networking device can send an interrupt to indicate the received data packets. Furthermore, a timer can notify a timeout event to the CPU. An interrupt depends on the physical platform and the configuration of that platform. Therefore, two identical platforms will have the same interrupt. In addition, interrupts occur asynchronously.

Similarities Between Signal and Interrupt

  • Signals and interrupts have unique IDs.
  • Both can be masked. They help to disable or suspend the notification the signal or interrupt is delivering.

Difference Between Signal and Interrupt

Definition

A signal is an event that is triggered by the CPU or the software that runs on the CPU. In contrast, an interrupt is an event that is triggered by external components other than the CPU that alerts the CPU to perform a certain action. The main difference between signal and interrupt is explicit from these definitions. 

Dependency

While a signal depends on the platform, an interrupt depends on the operating system. Thus, this is an important difference between signal and interrupt.

Signal type

Another difference between signal and interrupt is that a signal can be synchronous or asynchronous whereas an interrupt is asynchronous.

Mask

Moreover, a signal uses a per process signal mask while an interrupt uses a pre CPU interrupt mask.

Association with CPU

The CPU sends the signals to processes whereas the CPU receives the interrupts from external components. This is another difference between signal and interrupt.

Conclusion

The difference between signal and interrupt is that signal is an event that is triggered by the CPU or the software that runs on the CPU while an interrupt is an event that is triggered by an external component other than the CPU.

Reference:

1. “Interrupts and Signals Intro”, Udacity, 23 Feb. 2015, Available here.
2. “What Is an Interrupt? – Definition from Techopedia.” Techopedia.com, Available here.

Image Courtesy:

1. “ANS700-CPU-board” By Henrik Wannheden – Own work (Public Domain) via Commons Wikimedia

About the Author: Lithmee

Lithmee holds a Bachelor of Science degree in Computer Systems Engineering and is reading for her Master’s degree in Computer Science. She is passionate about sharing her knowldge in the areas of programming, data science, and computer systems.

Leave a Reply