北航深入理解计算机系统,北航《计算机系统》ComputerSystems 08-1-exceptions.pdf

这篇博客探讨了计算机系统中控制流的概念,CPU如何按照指令序列执行任务。文章指出,除了程序状态变化引起的跳转和分支,系统状态变化(如数据到达、除零错误、用户键盘中断或系统定时器到期)也需要异常控制流(ECF)来处理。ECF包括硬件和操作系统软件的组合,涉及异常、过程上下文切换、信号和非本地跳转等机制。
摘要由CSDN通过智能技术生成

Today

 Exceptional Control Flow

 Processes

1

Control Flow

 Processors do only one thing:

 From startup to shutdown, a CPU simply reads and executes

(interprets) a sequence of instructions, one at a time

 This sequence is the CPU’s control flow (or flow of control )

Physical control flow

inst

1

inst

Time 2

inst

3

inst

n

2

Altering the Control Flow

 Up to now: two mechanisms for changing control flow:

 Jumps and branches

 Call and return

Both react to changes in program state

 React to changes in system state

 data arrives from a disk or a network adapter

 instruction divides by zero

 user hits Ctrl-C at the keyboard

 System timer expires

 System needs mechanisms for “exceptional control flow” (ECF)

3

Exceptional Control Flow

 Exists at all levels of a computer syste

 Low level mechanisms

 Exceptions

 change in control flow in response to a system event

(i.e., change in system state)

 Combination of hardware and OS software

 Higher level echanisms

 Process context switch

 Signals

 Nonlocal jumps: setjmp() / longjmp()

 Implemented by either:

 OS software (context switch and signals)

 C language runtime library (n

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值