操作系统概念(英文)——大纲及总结共28页文档

合集下载

操作系统概念(英文)

操作系统概念(英文)

October 2012 Operating System Concepts- Chapter4 Threads 10
a traditional process as a single-thread
more than one thread in one process
Fig.4.1 Single and Multithreaded Processes
+
resource shared by all threads in the process
Traditional process, also named heavyweight process, has a single thread of control A thread is also called a lightweight process (LWP)
October 2012 Operating System Concepts- Chapter4 Threads 9
Basic concepts (cont.)
线程内容 tID 程序计数器 堆栈 寄存器组 状态 子线程
进程内容 PID 地址空间 全局变量 打开文件 子进程 定时器 信号 信号量 记账信息

October 2012
Operating System Concepts- Chapter4 Threads -
3
4.1 Overview
4.1.1Why thread needed As described in Chapter 3, the process is as the unit of resource allocation unit of CPU scheduling The costs of process management, such as costs of process creation, cancellation, process switch and process communication, are somewhat high, refer to Fig.3.4, and the concurrency (or multiprogramming degree) may be limited. To reduce costs of process management and improve degrees of concurrency and parallelism, the thread is presented

操作系统概念(英文)——大纲及总结

操作系统概念(英文)——大纲及总结

CPU
main memory
summary
OS
DOS
features
simple/ill-structured
Unix
Mach OS2
kernel
micro-kernel layered
Solaris
Windows NT/XP, Mac OS X
Jan 2010
module
(micro-)kernel + layered
accounting User interfaces file system manipulation I/O operations program Execution (dynamic) resource allocation protection and security
services
(§2.1) (§1.2) hardware

Jan 2010
Operating System Concepts-
1
CHAPTER 1
Interrupt vs. trap(陷阱、内部中断) Storage structure and hierarchy caching, Fig. 1.4 Dual mode operation and privileged instructions (1.5) System call
communication
error detection
OS components/functions
networking
Command-interpreter system
file
management Secondary storage management

操作系统概念(英文)

操作系统概念(英文)

December 2012
Operating System Concepts - Chapter9 Virtual Memory -
3
An Introduction to Chapter 9 (cont.)

In multiprogramming VM systems, four issues must be addressed on when a process is to execute a instruction that is not in memory, OS loads the page or the segment in which the instruction exists by means of demand-paging(§9.2) or demand-segmentation. OS uses frame-allocation policies/algorithms (§9.5) to allocate free frames for the loaded pages, and a frame can be shared by more than one process in the system. if there are not enough free frames for allocation, OS uses page-replacement (§9.4) policies/algorithms to find some free frames.

Paging or segmentation vs. Demand paging or demand segmentation real memory schemes vs virtual memory schemes

操作系统概念(英文)

操作系统概念(英文)

December 2010
Operating System Concepts - Chapter9 Virtual Memory -
2
Solution (cont.)

(2) 若再增加300K内存,系统可容纳4个进程同时并发执 行 4 此时,CPU的利用率为 (1— (80%) ) = (1— 0.4096) = 0.5904 所以,若再增加300K内存,cpu利用率可提高: (0.5904—0.488) / 0.488 = 20.98%
Operating System Concepts - Chapter9 Virtual Memory 1

December 2010
Solution

(1) 当系统内存为900K时, 系统可容纳3个进程同时并发执 行 根据题意,进程在执行过程中有80%的I/O等待时间, 表明进程等待I/O的时间占其生命周期时长的80%, 进 程处于waiting状态的概率为0.8 对系统内并发执行的n个进程, 当这n个进程同时处于 I/O等待时, cpu是空闲的 系统内3个并发进程同时处于I/O等待态而导致CPU空闲 的概率为(80%)3=0.512 因此,系统有51.2%的CPU时间被浪费掉了,系统CPU 的利用率为(1—51.2%)=48.8%。
Operating System Concepts - Chapter9 Virtual Memory 4
December 2010
December 2010
Operating System Concepts - Chapter9 Virtual Memory -
3
Solution (cont.)

(3)根据题意,设系统内每个进程在其生命周期内处于 running态执行程序指令的总时间均为T 当系统内存为900K时, 系统可容纳3个进程并发执行。如 果3个进程全部执行完所需时间为L3,则: CPU的利用率=3T / L3=48.8%, L3 = 3T / (48.8%), , 系统吞吐量Th3=3/ L3= (48.8%) / T 当系统内存由900K增至1200K时,系统可容纳4个进程 同时并发执行。设4个进程全部执行完所需时间为L4,则: CPU的利用率 = 4T / L4=59.04%, L4=4T / (59.04%), 系统吞吐量Th4=4/ L4= (59.04%) / T 因此,若再增加300K内存,系统吞吐量可提高: [(59.04%) / T —(48.8%) / T]/ [(48.8%) / T] = (0.5904—0.488) / 0.488 = 20.98% = 20.98%

操作系统概念(英文)

操作系统概念(英文)

October 2012
Operating System Concepts-Chapter 6 CPU Scheduling -
3
5.1 Basic Concepts (cont.)
5.1.2 The cycle of process execution Process execution consists of a cycle of CPU execution and I/O wait, i.e., CPU burst and I/O burst e.g. Fig.5.1
October 2012
Operating System Concepts-Chapter 6 CPU Scheduling -
7
5.1 Basic oncepts (cont.)
5.1.3 Who conduct CPU Scheduling As components of OS, scheduler (§5.1.2) and dispatcher (§ 5.1.4, 分配器,调度器)are responsible for CPU scheduling
October 2012 Operating System Concepts-Chapter 6 CPU Scheduling 10
5.1 Basic Concepts (cont.)
Scheduling under condition 1 and 2 is nonpreemptive (非抢占 式), because the CPU becomes in idle All other scheduling is preemptive (抢占式), often used in real-time systems

操作系统概念(英文)

操作系统概念(英文)
Operating System Concepts- Chapter1 Introduction 9

September 2012
§1.2 Computer-System Organization
1.2.1 Computer-System Operation Fig. 1.2 A modern computer system
Commonly acknowledged classifications of OS PC/Desktop OS : Windows, Linux,Mac OS X Server OS : Unix, Linux, Windows NT Mainframe OS : Unix, Linux——open source!! Embedded OS : Vxworks, (Palm OS), (Symbian), (WinCE)/Windows Mobile/Phone, Android, iOS, embedded Linux (e.g. μcLinux)

September 2012 Operating System Concepts- Chapter1 Introduction 8
1.1.2 OS Concepts (cont.)

For OS definitions in other textbooks, refer to Appendix 1.B OS definitions
September 2012
Operating System Concepts- Chapter1 Introduction -
3
Fig.1.1-1 Components of a computer system
Application Software

操作系统概念(英文)

操作系统概念(英文)
5 页面替换策略
•页面替换 •页面淘汰算法 •“抖动”(Thrashing)现象
影响缺页中断率的因素(1)
• 假定作业p共计n页,系统分配给它 的主存块只有m块(1≤m≤n)。 如果作业p在运行中成功的访问次数 为s, 不成功的访问次数为F,则总 的访问次数A为: A=S+F 又定义: f=F/A
2)先进先出页面替换算法(FIFO)
• 基于程序总是按线性顺序来访问物 理空间这一假设。 • 算法总是淘汰最先调入主存的那一 页,或者说在主存中驻留时间最长 的那一页(常驻的除外)。
FIFO实现技术
• 系统中设臵一张具有m个元素的页号表, 它是M个数: P[0], P[1], …, P[m-1] 组成的数组,每个P[i] (i =0,1,…m-1) 存储一个在主存中的页面的页号。用 指针k指示当前调入新页时应淘汰的那 一页在页号表中的位臵。每当调入一 个新页后,执行 P[k] := 新页的页号; k := (k+1)mod m;
Page9 use=1
Page19 Use=1
Page1 Use=0
2
Page1 Use=0
2
下一个 帧指针
Page3 3 Use=1 Page222 Use=0
7
Page4 5 Use=1 Page191 Use=1 Page556 Use=0
3 8
Page222 Use=0 Page3 3 Use=1
计算缺页中断实例(1)
• 假设固定分配,运行FORTRAN程序, 共有0.25×106 次页面引用,页面 大小为256个字。分给进程的页框 数分别为6、8、10、12和14。 • FIFO所产生的缺页中断基本上是 Opt的2倍,Clock则比较接近于LRU。
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档