What is an interrupt?
An interrupt is a signal from a device attached to a computer or from a program within the computer that causes the main program that operates the computer (the operating system ) to stop and figure out what to do next. Almost all personal (or larger) computers today are interrupt-driven - that is, they start down the list of computer instruction s in one program (perhaps an application such as a word processor) and keep running the instructions until either (A) they can't go any further or (B) an interrupt signal is sensed. After the interrupt signal is sensed, the computer either resumes running the program it was running or begins running another program.
Basically, a single computer can perform only one computer instruction at a time. But, because it can be interrupted, it can take turns in which programs or sets of instructions that it performs. This is known as multitasking . It allows the user to do a number of different things at the same time. The computer simply takes turns managing the programs that the user effectively starts. Of course, the computer operates at speeds that make it seem as though all of the user's tasks are being performed at the same time. (The computer's operating system is good at using little pauses in operations and user think time to work on other programs.)
An operating system usually has some code that is called an interrupt handler . The interrupt handler prioritizes the interrupts and saves them in a queue if more than one is waiting to be handled. The operating system has another little program, sometimes called a scheduler , that figures out which program to give control to next.
In general, there are hardware interrupts and software interrupts. A hardware interrupt occurs, for example, when an I/O operation is completed such as reading some data into the computer from a tape drive. A software interrupt occurs when an application program terminates or requests certain services from the operating system. In a personal computer, a hardware interrupt request ( IRQ ) has a value associated with it that associates it with a particular device.
What does an interrupt do to the “flow of control”
Interrupts used to overlap computation & I/O
Examples would be console I/O, printer output, and disk accesses
Normally handled by the OS. Thus under UNIX and NT, rarely coded by ordinary programmers.
In embedded systems and real-time systems, part of the normal programming work.
What is an interrupt?An interrupt is a signal from a device attached to a computer or from a program within the computer that causes the main program that operates the computer (the operating system ) to stop and figure out what to do next. Almost all personal (or larger) computers today are interrupt-driven - that is, they start down the list of computer instruction s in one program (perhaps an application such as a word processor) and keep running the instructions until either (A) they can't go any further or (B) an interrupt signal is sensed. After the interrupt signal is sensed, the computer either resumes running the program it was running or begins running another program.Basically, a single computer can perform only one computer instruction at a time. But, because it can be interrupted, it can take turns in which programs or sets of instructions that it performs. This is known as multitasking . It allows the user to do a number of different things at the same time. The computer simply takes turns managing the programs that the user effectively starts. Of course, the computer operates at speeds that make it seem as though all of the user's tasks are being performed at the same time. (The computer's operating system is good at using little pauses in operations and user think time to work on other programs.)ระบบปฏิบัติการมักจะมีบางรหัสที่เรียกว่าตัวจัดการการขัดจังหวะ จัดการขัดจังหวะ interrupts การจัดลำดับความสำคัญ และบันทึกลงในคิวถ้ามากกว่าหนึ่งกำลังรอการจัดการ ที่ระบบปฏิบัติการมีโปรแกรมเล็ก ๆ อื่น บางครั้งเรียกว่าตัวจัดกำหนดการ ตัวเลขการออกโปรแกรมที่จะให้ตัวควบคุมถัดไปทั่วไป มีฮาร์ดแวร์ interrupts และ interrupts ซอฟต์แวร์ การขัดจังหวะฮาร์ดแวร์เกิดขึ้น เช่น เมื่อการดำเนินการ I/O เสร็จเช่นอ่านข้อมูลบางอย่างลงในเครื่องคอมพิวเตอร์จากเทปไดรฟ์ การขัดจังหวะซอฟต์แวร์เกิดขึ้นเมื่อโปรแกรมประยุกต์ยุติ หรือร้องขอการบริการบางอย่างจากระบบปฏิบัติการ ในคอมพิวเตอร์ส่วนบุคคล การร้องขอสัญญาณขัดจังหวะฮาร์ดแวร์ (IRQ) มีค่าที่เกี่ยวข้องที่เชื่อมโยงกับอุปกรณ์เฉพาะการขัดจังหวะทำให้ "กระแสควบคุม" อะไรขัดจังหวะใช้สนับคำนวณและ I/Oตัวอย่างจะเป็นคอนโซล I/O เครื่องพิมพ์ผล และการเข้าถึงดิสก์โดยปกติจะถูกจัดการ โดยระบบปฏิบัติการ ดังนั้นภายใต้ UNIX และ NT ไม่ค่อยมีกำหนด โดยทั่วไปโปรแกรมเมอร์ในฝังระบบและระบบเรียลไทม์ ส่วนหนึ่งของงานเขียนโปรแกรมปกติ
การแปล กรุณารอสักครู่..
