Is the interruption profound? No! Learn about it with me! (1)

Source: Internet
Author: User
1. CPU: tell me that you are ready through "interruption!
With the development of computers today, the speed of CPUs has been far beyond the speed of various computer devices, so there is a very high speed conflict between them. If the CPU sends a command to a device, it also wastes a lot of time waiting for it to start and prepare data. Therefore, scientists have designed the "interrupt" function. With this function, the CPU and Peripherals can work at the same time. After the CPU starts the corresponding peripherals according to the user's needs, it continues to process data, at the same time, the peripherals are also working. When the peripherals prepare the data, they will send a signal to the CPU, requesting the CPU to interrupt its processing work, and then execute a program specially designed for this device, convert the data of the device to the corresponding operation. The request process is called "interrupt request" (IRQ: interrupt request ), this signal is the "interrupt request signal" (interrupt request signal ). The number followed by IRQ indicates the interrupt program to be executed by the CPU. For example, the keyboard uses IRQ 1 and the hard disk controller uses IRQ 14. Example: for example, if your lover (CPU) is watching a video album, she is going to cook at, but suddenly think that soy sauce is gone, so let you (device, receive instructions from CPU) buy a bottle at the supermarket, and then watch the album. When you buy soy sauce and hand it over to her (interrupt the request ), she stops playing the video disc (stops the job being processed) and cooks in the kitchen. After dinner, she continues to finish the unfinished album. With the above understanding, we can explain the process in detail. When Windows is started, each device will be allocated an interrupt for the operating system and CPU to facilitate communication with the device, for example, a sound card is usually allocated to IRQ 5. In this way, when the cpu requires the sound card to play music, it will send a command to IRQ 5. The sound card starts working immediately. After preparation is complete, it sends the prepared interrupt signal to the CPU, and the CPU stops the work at hand to process the data sent by the sound card, so the music starts. 2. CPU: There are a lot of "interrupted requests". What should I do?
If multiple devices send an "interrupt request signal" at the same time, there must be priorities and priorities, therefore, before the device's "interrupt request signal" reaches the CPU, it must go through a control chip called "interrupt controller" (most of them are now integrated into other chips ), it not only converts the device's "interrupt request signal" to the signal level sent to the CPU, but also specifies the Priority Scheme of the interrupt: when a device sends an interrupt signal with a specified priority, the Controller blocks (or limits) the signal) all interrupt signals sent from other devices to the CPU with a priority less than or equal to the interrupt priority of the device. In addition to the interrupt priority scheme, there is also a rough classification of interruptions, that is, blocked interruptions and unshielded interruptions (the highest level of the system, which users cannot control ), blocking interrupts means that the CPU can temporarily block or ignore interrupt requests to continue the current task. The unblocking interruption means that the corresponding interrupt processing program is activated directly and cannot be delayed. We often say that IRQ interruption is a blocked hardware interruption. Fan bow.y "unt7q
TipsWho said I could handle multiple tasks at the same time? Fans: Bo Yun & y4y ~ -R e1 _~ (Hgc8r
Many friends may think that the current CPU can process multiple tasks at the same time. In fact, this is a wrong concept. Even the fastest CPU can only process one task at a time, it's just that the processing speed is extremely fast and we usually don't feel it, so it looks like it can process multiple tasks at the same time.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.