Posts

Interrupt – Excuse Me

In this post I will talk about interrupts and why they are essential to the computer. An interrupt may be thought of an exception in JAVA. The book defines it as a “signal that causes the CPU to alter its normal flow of instruction execution.”  Every time you move your mouse an interrupt occurs in which enables you to actually move the mouse. As you might know the processer on a computer can only do one thing at a time. When you move your mouse it “stops” what it is doing and moves the pointer according to your hand movement.  Because the processor is relatively fast, the user of the GUI doesn’t see the lag and feels that everything is run simultaneously; I will talk more about this in a later post.

Some of the uses of interrupts include*:

  • Notify that an external event has occurred
  • Signal completion
  • Allocate CPU time
  • Indicate abnormal event
  • Software interrupts

One of the most important interrupts is the Direct Memory Access. When accessing data on a disk the programmed I/O will start loading data into memory. The CPU has no way of knowing whether the disk controller has completed the transfer unless it is told so.  When the data transfer is completed the device shoots a completion interrupt telling the CPU that the data is ready to use. The interrupt here service as a point of communication. It is like saying “over” on a walkie-talky, informing the person on the other end you are done talking and giving him the flow of control to talk.

*taken from the PPTs