中断和例外 [英] Interrupts and exceptions

查看:203
本文介绍了中断和例外的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里看到关于例外情况的几个问题,还有一些他们暗示中断作为例外情况,但没有使连接清除。

I've seen several question on here about exceptions, and some of them hint at interrupts as exceptions, but none make the connection clear.


  • 什么是中断?

  • What is an interrupt?

有什么例外? (请说明您所了解的每种语言的例外情况,因为有一些差异)

What is an exception? (please explain what exceptions are for each language you know, as there are some differences)

什么时候中断是异常的?反之亦然? >

When is an exception an interrupt and vice-versa?

-Adam

推荐答案

中断是由硬件或特定CPU指令生成的CPU信号。这些导致中断处理程序被执行。诸如来自I / O硬件的I / O信号等事件会产生中断。

An interupt is a CPU signal generated by hardware, or specific CPU instructions. These cause interupt handlers to be executed. Things such as I/O signals from I/O hardware generate interupts.

异常可以被认为是中断的软件版本,仅影响其进程

An exception can be thought of as a software-version of an interupt, that only affects its process.

我不确定具体的细节,但可以通过中断来执行例外

I'm not sure on the exact details, but an exception could be implemented by an interupt.

这篇关于中断和例外的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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