The "Holy Bible" for embedded engineers
Points to consider:
What is Interupt?
An interrupt is a signal to the processor emitted by hardware or software indicating an event that needs immediate attention.
There are two types of interrupt: Software and Hardware.
hareware interrupt (external interrupt) can be divided into two catagories: blockable interrupt and unblockable interrupt.
Blockable interrupt are interrupts that can be blocked, usually issues by not so important peripheral devices such as printer. Unblockable interrupts must be served by the operating system such as disk reading error.
What happen during an interrupt operation?
Whenever an interrupt occurs, the controller completes the execution of the current instruction and starts the execution of an Interrupt Service Routine (ISR) or Interrupt Handler. ISR tells the processor or controller what to do when the interrupt occurs. The interrupts can be either hardware interrupts or software interrupts.
Useful Links:
Interrupts, Exceptions, and System Calls
Counting Semaphore: most often used to manage a shared resource that has limitation on the number of simultaneous users. e.g. The number of simultaneous Socket connections.
Binary semaphore is counting semaphore with counts up to 1, usually used for synchronization purpose.
Howevevr, using binary semaphore may cause priority inversion, in which a lower-priority tasks takes precedence over a higher-priority task.