Chanpter Exceptional Control Flow-- Classes of Exceptions

来源:互联网 发布:淘宝网页怎么看直播 编辑:程序博客网 时间:2024/05/21 08:57

Class         Cause                                      Async/Sync                              Return behavior

————————————————————————————————————————————————————
Interrupt   Signal from I/O device              Async                            always returns to next instruction

————————————————————————————————————————————————————
Trap          Intentional exception               Sync                              Always returns to next instruction
Fault         Potentially recoverable error    Sync                              Might return to current instruction or abort
Abort        Nonrecoverable error                Sync                              Never returns

————————————————————————————————————————————————————

 

 

Interrupt

Interrupt是异步的,因为事件从I/O设备传来。处理这个事件,必须等到当前指令执行完毕。

 

 

The remaining classes of exceptions (traps, faults, and aborts) occur synchronously as a result of executing
the current instruction. We refer to this instruction as the faulting instruction.

而接下来的exception呢,都是因为执行当前指令导致。所以是同步的。这些指令叫做 faulting instruction.

 

 

Traps

traps的重要的一种形式是 system call。

 

Faults

发生fault时,系统接管进行处理,如果能够修复就返回到前面那条指令继续执行。 如果不能修复,则abort。

fault的重要的一种形式是 page fault exception

 

Abort

abort是无法修复的,只有退出了。

原创粉丝点击