《操作系统》课程教学资源(PPT课件)第四章 Processes 进程

Module 4: processes 进程 ° Process Concept 进程概念 ● Process Scheduling 进程调度 Operation on Processes 进程上的操作 e Cooperating processes 协同进程 e Interprocess Communication 进程间通信 Applied Operating System Concepts
4.1 Applied Operating System Concepts Module 4: Processes 进程 • Process Concept 进程概念 • Process Scheduling 进程调度 • Operation on Processes 进程上的操作 • Cooperating Processes 协同进程 • Interprocess Communication 进程间通信

Process Concept 进程概念 An operating system executes a variety of programs: 操作系统执行各种程序 Batch system-jobs批处理系统-作业 Time-shared systems -user programs or tasks 分时系统用户程序或任务 Textbook uses the terms job and process almost interchangeably.本书使用的名词作业和进程,基本可互换 Process-a program in execution; process execution must progress in sequential fashion. 进程-在执行中的程序;进程的执行必须以顺序方式进行 A process includes:个进程包括 program counter程序计数器 stack栈 data section数据部分 Applied Operating System Concepts
4.2 Applied Operating System Concepts Process Concept 进程概念 • An operating system executes a variety of programs: 操作系统执行各种程序 – Batch system – jobs 批处理系统 - 作业 – Time-shared systems – user programs or tasks 分时系统 - 用户程序或任务 • Textbook uses the terms job and process almost interchangeably. 本书使用的名词作业和进程,基本可互换 • Process – a program in execution; process execution must progress in sequential fashion. 进程 - 在执行中的程序;进程的执行必须以顺序方式进行 • A process includes: 一个进程包括 – program counter 程序计数器 – stack 栈 – data section 数据部分

Process state 进程状态 As a process executes, it changes state 进程执行时,改变状态 new: The process is being created. 新建:在创建进程 running: Instructions are being executed. 运行:指令在执行 waiting: The process is waiting for some event to occur 等待:进程等待某些事件发生 ready The process is waiting to be assigned to a processor. 就绪:进程等待分配处理器 terminated: The process has finished execution 终止:进程执行完毕 Applied Operating System Concepts
4.3 Applied Operating System Concepts Process State 进程状态 • As a process executes, it changes state 进程执行时,改变状态 – new: The process is being created. 新建:在创建进程 – running: Instructions are being executed. 运行:指令在执行 – waiting: The process is waiting for some event to occur. 等待:进程等待某些事件发生 – ready: The process is waiting to be assigned to a processor. 就绪:进程等待分配处理器 – terminated: The process has finished execution. 终止:进程执行完毕

Diagram of Process state 进程状态图 admitted interrupt exit terminated ready running scheduler dispatch vo or event completion vo or event wait alting Applied Operating System Concepts 4.4
4.4 Applied Operating System Concepts Diagram of Process State 进程状态图

Process Control Block(PCB) 进程控制块 Information associated with each process 同进程有关的信息 ● Process state =进程状态 ● Program counter 程序计数器 ° CPU registers CPU寄存器 CPU scheduling information CPU调度信息 Memory-management information内存管理信息 Accounting information 计账信息 e o status information O状态信息 Applied Operating System Concepts 4.5
4.5 Applied Operating System Concepts Process Control Block (PCB) 进程控制块 Information associated with each process. 同进程有关的信息 • Process state 进程状态 • Program counter 程序计数器 • CPU registers CPU寄存器 • CPU scheduling information CPU调度信息 • Memory-management information内存管理信息 • Accounting information 计账信息 • I/O status information I/O状态信息

Process Control Block(PCB) 进程控制块 pointer process state process number program counter registers memory limits list of open files Applied Operating System Concepts
4.6 Applied Operating System Concepts Process Control Block (PCB) 进程控制块

CPU Switch From Process to Process 进程间cPU的切换 process operating system process P interrupt or system call g save state into PCB e reload state from PCB, nterrupt or system call executing save state into PCB, reload state from PCBo executing Applied Operating System Concepts 4.7
4.7 Applied Operating System Concepts CPU Switch From Process to Process 进程间CPU的切换

Process Scheduling queues 进程调度队列 Job queue-set of all processes in the system 作业队列-在系统中的所有进程的集合 Ready queue- set of all processes residing in main memory, ready and waiting to execute. 就绪队列-在主内存中的,就绪并等待执行的所有进程的集合 Device queues- set of processes waiting for an l/o device. 设备队列等待某一O设备的进程队列 Process migration between the various queues 在各种队列之间进程的迁移 Applied Operating System Concepts 48
4.8 Applied Operating System Concepts Process Scheduling Queues 进程调度队列 • Job queue – set of all processes in the system. 作业队列 - 在系统中的所有进程的集合 • Ready queue – set of all processes residing in main memory, ready and waiting to execute. 就绪队列 - 在主内存中的,就绪并等待执行的所有进程的集合 • Device queues – set of processes waiting for an I/O device. 设备队列 - 等待某一I/O设备的进程队列 Process migration between the various queues. 在各种队列之间进程的迁移

Ready Queue And various lO Device Queues 就绪队列和各种ⅣO设备队列 queue header PCB PCB rea dy head queue tail registers registers mag head tape unit o tail mag head tail PCB PCB,4 PCB disk head unit o ta PCB terminal head unit 0 tal Applied Operating System Concepts
4.9 Applied Operating System Concepts Ready Queue And Various I/O Device Queues 就绪队列和各种I/O设备队列

Representation of Process Scheduling 进程调度的描述 ready queue CPU l/ 1o queue 1O request time slice expired child fork a executes child interrupt wait for an occurs interrupt Applied Operating System Concepts 4.1
4.10 Applied Operating System Concepts Representation of Process Scheduling 进程调度的描述
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《操作系统》课程教学资源(PPT课件)第十章 Virtual Memory.ppt
- 《操作系统》课程教学资源(PPT课件)第十八章 Protection(保护).ppt
- 《操作系统》课程教学资源(PPT课件)第十二章 I/O Systems(I/O系统).ppt
- 《操作系统》课程教学资源(PPT课件)第十九章 Security(安全).ppt
- 《操作系统》课程教学资源(PPT课件)第十三章 Secondary-Storage 二级存储.ppt
- 《操作系统》课程教学资源(PPT课件)第十一章 File-System Interface(文件系统接口).ppt
- 《操作系统》课程教学资源(PPT课件)第六章 CPU Scheduling.ppt
- 《操作系统》课程教学资源(PPT课件)第八章 Deadlocks(死锁).ppt
- 《操作系统》课程教学资源(PPT课件)第五章 Threads线程.ppt
- 《操作系统》课程教学资源(PPT课件)第二章 Computer-System Structures 计算机系统结构.ppt
- 《操作系统》课程教学资源(PPT课件)第九章 Memory Management.ppt
- 《操作系统》课程教学资源(PPT课件)第三章 Operating-System Structures 操作系统结构.ppt
- 《操作系统》课程教学资源(PPT课件)第七章 Process Synchronization.ppt
- 《操作系统》课程教学资源(PPT课件)第一章 Introduction 引论.ppt
- 《操作系统》课程教学资源(PPT课件)Applied Operating System Concepts(AOSC)介绍.ppt
- 国防科技大学:《复杂网络可靠性研究》 概述讲解.ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第九章 图象分析(数学形态学图像处理、遥感信息处理).ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第九章 图象分析(分割、描绘).ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)第八章 三维图像处理技术.ppt
- 《数字图像处理》课程教学资源(PPT课件讲稿)预测编码、变换编码、静态图象的一些主要数据文件压缩方式、图象编码的国际标准.ppt
- 《实用网络技术》 第四章(4-1) 网络技术基础.ppt
- 《实用网络技术》 第四章(4-2) 同轴电缆.ppt
- 《实用网络技术》 第四章(4-3) 地球同步卫星.ppt
- 《实用网络技术》 第四章(4-4).ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)内容导航(崔雅娟).ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第一章 程序设计概述.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第七章 指针.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第三章 语句及控制结构.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第九章 文件.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第二章 数据类型、运算符与表达式.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第五章 预处理命令.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第八章 结构及其它.ppt
- 北京语言文化大学:《C语言程序设计导论》课程教学资源(PPT课件)第六章 数组.ppt
- 京语言文化大学:《C语言程序设计导论》 第四章 函数和程序结构.ppt
- 浙江大学计算机学院:《C语言程序设计》 第一章 用C语言编写程序.ppt
- 浙江大学计算机学院:《C语言程序设计》 第十二章 文件.ppt
- 浙江大学计算机学院:《C语言程序设计》 第二章 基本数据类型和表达式.ppt
- 浙江大学计算机学院:《C语言程序设计》 第三章 算法与c程序设计.ppt
- 浙江大学计算机学院:《C语言程序设计》 第四章 分支结构程序设计.ppt
- 浙江大学计算机学院:《C语言程序设计》 第五章 循环结构程序设计.ppt