禁用中断是什么意思? [英] what is meant by disabling interrupts?

查看:71
本文介绍了禁用中断是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当进入中断处理程序时,我们首先在该CPU上禁用中断"(使用x86上的cli指令之类的方法).在禁用中断的时间内,假设用户按下了键盘上的字母"a",这通常会导致中断.但是由于禁止了中断,这是否意味着:

When entering an inteerupt handler, we first "disable interrupts" on that cpu(using something like the cli instruction on x86). During the time that interrupts are disabled, assume say the user pressed the letter 'a' on the keyboard that would usually cause an interrupt. But since interrupts are disabled, does that mean that:

  1. 'a'的中断处理程序将永远不会被调用,因为在关键部分或
  2. 中禁用了中断
  3. 中断将由os处理,但会延迟,直到再次允许中断为止. 具体来说,如果用户第一次按下"a"是在禁用中断的时候,是否需要再次按下"a"?
  1. the interrupt handler for 'a' would never be invoked, since interrupts are disabled in the critical section or
  2. the interrupt will be handled by the os but delayed, until interrupts are enabled again. Specifically, will the user need to press 'a' again, if the first time he pressed 'a' was at a time when interrupts were disabled ?

推荐答案

通常,一个中断被硬件排队".

Often, one interrupt is "queued" by hardware.

[中断通常只是一个可以继续存在的逻辑门;一旦打开,它会保持一段时间.]

[An interrupt is often just a logic gate that can stick on; once it's on, it stays on for a while.]

如果用户仅在禁用中断的间隔内单击一次"a",则在重新启用中断时将注册为中断.

If the user hit 'a' once only during the interval when interrupts were disabled, it would register as an interrupt when they were re-enabled.

如果在中断被禁用的时间间隔内,用户设法以某种方式成功命中两次"a",则在中断被启用时,该用户将注册为中断.是第一个还是第二个取决于确切的逻辑门配置.

If the user somehow managed to hit 'a' twice during the interval when interrupts were disabled, one would register as an interrupt when they where enabled. Whether it was the first or the second depends on the exact logic gate configuration.

这篇关于禁用中断是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆