Forgot your password?  

Not What You Meant?  There are 14 definitions for INT.  Also try: IRR or Lint.

Interrupt | Research & Encyclopedia Articles

Print-Friendly   Order the PDF version   Order the RTF version
About 2 pages (615 words)
Interrupt Summary

 


Interrupt

An interrupt is a signal from a peripheral device, like a printer or a scanner, attached to a computer; or from a program running on the computer itself that causes the computer's operating system to suspend the task it is currently working on and do something else instead. This "something else" is most often something to do with the device that sent the interrupt, e.g., service the printer, read a key from the keyboard, and so on.

The code that runs to handle the interrupt is often called an "interrupt service routine" or ISR. ISRs are typically run by the operating system, which is the main program in the computer, and which acts as host to the other programs the computer can run. Windows, MacOS, Linux, and UNIX are all operating systems. The operating system is to the computer what the laws of physics are to us: the operating system determines what the program-inhabitants can get away with in their computer universe.

Most modern computers are interrupt-driven. This means that they will execute the program or programs the user selects and will continue with their normal execution until either the programs stop, or a device or another program sends an interrupt.

Despite appearances to the contrary, a computer with a single central processing unit (CPU) can only do one thing at a time. Computers appear to be able to do many things at once because they work very quickly and switch between tasks frequently, giving each task a small "slice" of time during which it has the CPU's undivided attention. This is called "multitasking."

Multitasking allows the user to do a number of different things, all apparently at the same time. But in reality, at any instant the computer is only actually doing one thing. This ability to multitask also allows the CPU to receive and service interrupts without it impinging on the user's perception of how the computer is running the programs the user really wants it to run.

For example, modern word processors allow "background printing," which means that the computer can print a document while the user is typing into another one. During this time, the computer is constantly switching between the word processor and the interrupt service routines prompted by interrupts from the printer, but the user is usually none the wiser. To all appearances the computer is simultaneously printing and handling the user's typing.

An operating system usually has some dedicated process or function that is responsible for managing interrupts. This is called an "interrupt handler" or "device handler." The interrupt handler queues incoming interrupts, ordering them according to their priority. Another process that runs in the operating system is called the "scheduler," and this has the task of deciding which process can use the services of the CPU next and for how long it can use them. Scheduling is a complicated topic as care must be taken not to let a program or ISR hog the CPU for too long and hold everything else up.

In general there are two fundamental types of interrupt: hardware interrupts and software interrupts. A hardware interrupt occurs, for example, when a hardware device such as a disc drive signals to the computer that it has completed some operation, such as reading some data from a disc. Hardware interrupts can be further categorized as "maskable" and "non-maskable." A maskable interrupt is one that the programmer can tell the CPU to ignore using low-level machine code commands, whereas a non-maskable interrupt cannot be ignored and is always given attention by the CPU.

A software interrupt occurs when a user program requires certain services from the underlying operating system, such as "open a file on a disc," or "send some data to the network."

This is the complete article, containing 615 words (approx. 2 pages at 300 words per page).

Ask any question on Interrupt and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Interrupt from World of Computer Science. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.

Join BookRagslearn moreJoin BookRags

Join BookRagslearn moreJoin BookRags