25-26-2-操作系统原理-期末(软件学院)

习题出自教材 Operating System Concepts 第 9 版

一、选择题(10题,每题2分)

  1. To access the services of operating system (为访问操作系统服务), the interface is provided by the ( )
  1. 以下是死锁条件的 ( )
  1. Dynamic loading(动态载入) is ( )
  1. In the ( ) algorithm, the disk head moves from one end to the other, servicing requests along the way. When the head reaches the other end, it immediately returns(立即返回) to the beginning of the disk without servicing any requests on the return trip.
  1. An open file table has a ( ) associated with each file.
  1. One of the disadvantages of the priority scheduling algorithm(优先级调度算法的缺点)is that ( )
  1. Mutual exclusion implies (互斥意味着) that ( )
  1. With ( ) a requested page and several subsequent pages(随后几个页面) are read and cached.

二、判断(10题,每题2分)

  1. 网络连接故障会由操作系统处理
  2. 多道程序程度(degree)是指内存中的进程数
  3. 假设一个阻塞态进程正在等待 I/O,I/O 完成后将会转移到运行态
  4. 有3个进程共享4份资源,每个进程最多使用2份资源,这种情况下可能产生死锁
  5. 使用 TLB 的页式存储仍比 DMA 慢
  6. 对某些页面替换算法,随着分配帧的增加,缺页率可能上升
  7. FCFS算法优先将CPU分配给先请求的进程
  8. 相对路径从根目录开始

三、简答(共25分)

  1. (习题3.8)简述短、中、长期调度的区别
  2. (习题4.9)解释:使用多用户级线程的多线程解决方案,在多处理器系统上的性能是否优于单处理器系统?
  3. (习题6.4)多级队列中采用不同时间片大小的优点
  4. (习题8.29)对页表分页的目的
  5. (习题9.32)颠簸(thrashing)产生的原因是什么?系统如何检测颠簸?检测出后如何处理颠簸?
  6. (习题11.12)举出以下访问文件方式的应用程序实例

a) Sequential b) Random

四、页面替换(10分)

(习题 9.8)页号序列:1 2 3 4 2 1 5 6 2 1 2 3 7 6 3 2 1 2 3 6

对于以下替换算法,分别写出 4 和 6 个页框的情况下,发生缺页的次数

a)FIFO

b)LRU

c)Optimal

五、地址转换(15分)

段表

基地址长度
0210500
1230013
295100
31323580
4195096

将以下给出的逻辑地址转化为物理地址

(1)0 430

(2)1 10

(3)2 500

(4)3 400

(5)4 110

六、信号量和PV操作(10分)

3 个进程不停削苹果并吃掉,1 个进程无限提供资源。削并吃一个苹果需要苹果、刀、餐盘 3 种资源,3 个进程分别各自拥有一种资源,需要另外两种才能吃苹果。提供者进程每次将 2 种资源放在桌上,拥有剩下那种材料的吃苹果者吃苹果,吃完后会发出一个信号,告诉提供者吃完了,供给进程将另外两种资源放在桌上。要求按一定顺序循环进行。使用信号量和PV操作编写程序。