当前位置:网站首页>Interrupt and polling
Interrupt and polling
2022-06-23 13:42:00 【Little monster】
Interrupt and polling
introduction
serial interface ( Foreign name :Serial Interface, abbreviation : A serial port ) Is to use serial communication Mode extension interface , finger Data is transmitted bit by bit . The characteristic of serial interface is that the communication circuit is simple , As long as a pair of transmission lines can achieve two-way communication ( The telephone line can be directly used as the transmission line ), Thus greatly reducing the cost , special It is suitable for long distance communication , But the transmission speed is slow .
There are generally two ways for external devices to interact with the CPU : Interrupt and polling .
interrupt (Interrupt)
Interrupt is a kind of interrupt sent by hardware or software IRQ( Interrupt signal ), once CPU Received interrupt signal ,CPU The current task will be suspended , And keep the site , To respond to an interrupt request from a peripheral .
The interrupt notification mechanism asynchronously calls the attention of the processor through hardware signals , It solves the problem of resource waste caused by speed mismatch between external devices and processors .
polling (Polling)
quite a lot I/O Each device has a status register , Used to describe the current working state of the equipment , Whenever the state of the equipment changes , The device will modify the corresponding status register bits . By constantly querying the device's status register ,CPU You can know the status of the equipment , So as to carry out necessary I/O operation . In order to save CPU resources , Queries are often not continuous , But on a regular basis .
The polling method is simple 、 Easy to implement 、 Easy to control , There are a lot of applications in many small systems . Not very sensitive to those 、 Have a lot of CPU Resource system , Polling is widely used .
The disadvantages of the polling method :
- Increase system overhead . Both task polling and timer polling need to consume corresponding system resources .
- Unable to sense the change of equipment status in time . Changes in the state of the device within the polling interval can only be detected at the next poll , This will not meet the real-time sensitive application market .
- waste CPU resources . Whether the state of the equipment changes or not , Polling is always on , In practice , The state of most devices usually changes less frequently , Polling will be wasted CPU Time slice .
The difference between interrupt and polling
- Idling loss exists in polling mode , It is controllable and real-time . Consume a lot cpu The processing time of , Periodically and continuously detect the occurrence of external events .
- The high priority and fast response requirements of interrupts will cause... Under extreme conditions “ Live lock ” effect . Various I / O devices operate in parallel through interrupt processing , Increase the number of interrupts , Can cause CPU Unable to respond to interrupt ; If an interrupt occurs after the buffer is full of data . So in the process of data transmission , There is more chance of interruption , Will consume a lot of CPU The processing time .
- Interruption is not a protocol , It's a hardware mechanism ; Polling is the opposite .
- The processor checks the interrupt register every instruction cycle , If the interrupt register is valid , That is, there is an interruption , that cpu Will perform a series of interrupt related operations . That is to say, interruption is also necessary CPU check. Interrupt and polling are not the exact opposite .
边栏推荐
- 边缘和物联网学术资源
- 服务稳定性治理
- Monitor the cache update of Eureka client
- 腾讯的技术牛人们,是如何完成全面上云这件事儿的?
- 如何正确计算导入Excel的行数(POI/NPOI)
- Cifar announces the second stage pan Canadian AI strategy
- DBMS in Oracle_ output. put_ How to use line
- 美国的国家公园概览
- 64 channel telephone +2-channel Gigabit Ethernet 64 channel PCM telephone optical transceiver voice telephone to optical fiber
- 爱思唯尔-Elsevier期刊的校稿流程记录(Proofs)(海王星Neptune)(遇到问题:latex去掉章节序号)
猜你喜欢

Hanyuan high tech new generation green energy-saving Ethernet access industrial switch high efficiency energy-saving Gigabit Industrial Ethernet switch

quartus調用&設計D觸發器——仿真&時序波驗證

#云原生征文#深入了解Ingress
Detailed explanation of kubernetes log monitoring system architecture

618's money saving technology strategy is coming - experience the scene and get a 10 yuan cat super card!

First exposure! The only Alibaba cloud native security panorama behind the highest level in the whole domain

How did Tencent's technology bulls complete the overall cloud launch?

Simplify deployment with openvino model server and tensorflow serving

Online text filter less than specified length tool

有向图D和E
随机推荐
2 万字 + 30 张图 |MySQL 日志:undo log、redo log、binlog 有什么用?
Germancreditdata of dataset: a detailed introduction to the introduction, download and use of germancreditdata dataset
MySQL single database and table splitting using MYCAT
爱思唯尔-Elsevier期刊的校稿流程记录(Proofs)(海王星Neptune)(遇到问题:latex去掉章节序号)
1 channel 100m optical fiber transceiver 1 100m optical 1 100m electric desktop Ethernet optical fiber transceiver built-in power supply
618's money saving technology strategy is coming - experience the scene and get a 10 yuan cat super card!
Architecture design methods in technical practice
How long is the financial product? Is it better for novices to buy long-term or short-term?
32-way telephone +2-way Gigabit Ethernet 32-way PCM telephone optical transceiver supports FXO port FXS voice telephone to optical fiber
在線文本過濾小於指定長度工具
同花顺网上开户安全吗,需要注意什么
Simplify deployment with openvino model server and tensorflow serving
Quartus II 13.1 detailed installation steps
中断和轮询
Filtre de texte en ligne inférieur à l'outil de longueur spécifiée
交换两个数的三种方法原理解析
快速了解常用的非对称加密算法,再也不用担心面试官的刨根问底
Quartus II 13.1 安装步骤详解
POW共识机制
Has aaig really awakened its AI personality after reading the global June issue (Part 1)? Which segment of NLP has the most social value? Get new ideas and inspiration ~