I know that this topic was debated a long time ago (link: Difference between interrupt and event ), even though, I don't consider the answer adequate. The reason is the next: when one talks about events versus interruptions, the term events signifies something about hardware and not software. Moreover, according to that explanation, an event is predictable, not something which comes across suddenly, but, in the case of a wake-up event, this cannot be true, because this event is not "expected", it is something spontaneously. For instance, one may look at the stm32 datasheet and notice that there is a so-called wake-up event enable register. This "event" involves neither a specific piece of code to be executed nor something related to software stuff.
Difference between events and interruptions
2.3k Views Asked by pauk At
1
There are 1 best solutions below
Related Questions in EVENTS
- OpenLayer 3: Map pointer up event can not be triggered when the map created on overlay
- Angular scroll directive
- Setting multiple events in one ext.net button
- Detect if Application was suspended in OnNavigatedFrom for Windows Phone 8
- When in click a radio button, it scroll to the top. How to prenvent that?
- Event subscribed but null in child class (after threads initialize)
- How to get results each sec from "perf stat -d sleep 1000"
- How to register event for TextBox end editing
- Stop the installshield installation if a file is not found in vb.net
- How to capture the next event based on a condition
- Flask server to notify webclient when changes occur
- Google analytics event tracking, retrieve results
- What is the correct way to code event handlers for serializable model objects?
- Android version of NSNotificationCenter (event binding)
- Center JoptionPaneMessageDialog in parent element of the source element that generated the event
Related Questions in EMBEDDED
- PHP don't use temp file for upload
- Sparkfun SC16IS750 does not work on Raspberry Pi
- Reserve memory space in m_text memory region of FLASH on embedded target
- SAE J1939 Standards Collection -- How much is necessary?
- How to call multiple slaves for Spi data transmission?
- Deployment over GPRS to embedded devices
- Changing just one byte in SD card sector
- Comparion of values won't work without delay
- Better to pass struct, or pointer to struct?
- STM32F4 Handling peripheral error while making a DMA Transfer (RX)
- USB programming, transfer file from iOS device to Embedded os device?
- using Diab, dcc 5.9.4 to compile a windows executable
- does b64_pton() work if input contains special characters? I am using it in C code
- u-boot select boot partition based on GPIO state
- Why is a write to a memory-mapped peripheral register not actioned (LPC43xx)?
Related Questions in INTERRUPT
- Arduino RPM Detection
- Interrupting long working thread
- How to set privilaged mode in ARM Cortex-A8?
- TechWell TW6869 driver does not generate interrupts on embedded device
- Using class member function pointers in C++ for Arduino
- What's the shortcut to interrupt the kernel in Canopy?
- How to interrupt a thread with infinite loop and sleep in Java
- Why page fault is considered as trap
- externally ending infinite loop java
- DB2 SQLSTATE = 57014 error
- Using Thread.currentThread().isInterrupted() with Thread.sleep()
- Canceling a long-running function using an ISR
- TelosB GPIO interrupts in Contiki
- Interrupts for Data Ready pin
- How exactly do I interrupt a thread?
Related Questions in HARDWARE
- How to get temperature value from DS18B20 voltage
- Swich table in case of CRC error
- How verify server's hardware before install it into data center?
- What strategies and practices are used, when running very intense and long calculations, to ensure that hardware isn't damaged?
- Hardware upgrade for developing android App on Android studio
- XMega: CDC on USB composite controller does not function properly
- How do user-space applications control hardware (Location/Network/Wifi) in Android?
- How to get parameter name of "Target hardware"-Field in "Run on target hardware" in Matlab Simulink?
- lshw return network device is unclaimed, I need more diagnostic
- How to get started on creating a safe that will open and close upon entering a passcode into it?
- Generating fingerprint of virtual machines
- Can Java control hardware devices on PC?
- Using Dependency Injection for hardware abstraction
- Get Ram Information OSX
- Benefit of hardware with mobile access instead of wifi
Related Questions in MCU
- Would IIC SCL signals trigger MCU to enter debug mode when the IIC SCL pin and the STLINK SWCLK pin are connected to the same GF pin?
- How can I use STM32 sleep mode with UART
- Detecting SCL/SDA ports
- ESP32 Microcontroller ADC conversion problems
- Average values in c, without exceeding value data type?
- Union in bit field for mcu register mapping in C++
- C++ Virtual destructors ROM usage
- Configurations variables removed by compiler
- STM32H743ZI Nucleo seems unable to transmit via FDCAN 2?
- download file from BAIDU
- How to understand the return value of uxtaskgetstackhighlwatermark()
- MCUxpresso imr rt - Position Independent Code result in mem fault on free rtos task activation
- Why this MX_RTC_Init() function in STM32F4 make program stuck?
- Can Python do Factory Method design pattern?
- Difference between events and interruptions
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Events is a higher abstraction layer concept, usually found in system or application programming. They are not necessarily based on hardware, but could be purely triggered by software. There is no single definition of the term, it's pretty broad.
Interrupts on the other hand are always triggered by hardware, on the lowest level. Yet another term is hardware exceptions, upper-tier cores and microcontrollers often separate those as something thrown by the core or supervising hardware when some abnormal condition occurs (invalid instruction, divide by zero, memory access errors etc). Whereas interrupt sources could either be expected hardware behavior or some error condition.
Interrupts and hardware exceptions require the handler function to be registered in a hardware look-up table often called interrupt vector table. The hardware will go to this table when the interrupt occur to find the address of the function to call - such functions are named interrupt service routines (ISR). There will be a special calling convention for interrupts, where certain registers are stacked by the hardware before the ISR is called, and special return instructions from are used to restore the registers when the ISR is finished.
Events however use software callback functions, typically by the application passing on a function pointer upon event creation. That's typically how they are used in application programming and Rapid Application Development (RAD) tools. In embedded systems one might create something similar by letting the application register a number of callbacks for certain things that occur inside a driver, then let the driver call the callback. But even though a driver is the lowest-level code on top of the hardware, it is still software and performing a call designed by software.
But since "event" is such a broad term, in some cases events are objects that can be used together with broader API functions. And then they don't necessarily have a callback function - they are essentially just flags. In the Windows OS for example, the application programmer can create an event to signal something to a running thread, after which the thread can utilize a CPU effective sleep function and wait until the event is received. This is one of the normal ways to properly stop a thread by letting it finish up gracefully by itself.
What interrupts and events have in common is that they both lead to effective but non-deterministic execution. The program can do other things when the interrupt/event hasn't fired and it doesn't need to use polling of some flag, which is the alternative to interrupts. But when it fires, it aborts the current execution and disrupts it by executing something else. Also, it pushes some extra call on the stack in addition to the present call stack, so if it happens when the program is at its deepest call level, you can get very subtle errors like intermittent stack overflow.
Another issue with interrupts and possibly with events too is that they most often act as separate threads, with all the thread safety issues that come with them. You'll need to protect variables shared with the ISR/callback from race condition bugs, either by semaphores or by guaranteeing atomic access. Failing to do so is I'd say by far the all time most common error in embedded systems. This too creates incredibly subtle bugs.