进程(PPT课件讲稿)Processes

Processes
Processes

Outline contemporary computer systems allow multiple programs to be loaded into memory and executed concurrently a system therefore consists of a collection of processes a program in execution operating system processes executing system code and user processes executing user code · Process concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server SystemS
Outline • contemporary computer systems allow multiple programs to be loaded into memory and executed concurrently • A system therefore consists of a collection of processes (a program in execution): operating system processes executing system code and user processes executing user code. • Process Concept • Process Scheduling • Operations on Processes • Interprocess Communication • Examples of IPC Systems • Communication in Client-Server Systems*

Process concept a process is an instance of a program in execution Batch systems work in terms of jobs". Many modern process concepts are still expressed in terms of jobs, (e. g job scheduling and the two terms are often used interchangeably
Process Concept • A process is an instance of a program in execution. • Batch systems work in terms of "jobs". Many modern process concepts are still expressed in terms of jobs, ( e.g. job scheduling ), and the two terms are often used interchangeably

The process Process memory is divided into four sections max stack The text section comprises the compiled program code, read in from an executable program The data section stores global and static variables allocated and initialized prior to executing main The heap is used for dynamic memory allocation, and is managed via calls to new, delete malloc, free, etc The stack is used for function parameters, local variables return addresses data Current activity including status, program counter text processor registers,…
- The Process • Process memory is divided into four sections: • The text section comprises the compiled program code, read in from an executable program. • The data section stores global and static variables, allocated and initialized prior to executing main. • The heap is used for dynamic memory allocation, and is managed via calls to new, delete, malloc, free, etc. • The stack is used for function parameters, local variables, return addresses. • Current activity including status, program counter, processor registers, …

When processes are swapped out of cpu and later restored additional information must also be stored and restored Key among them are the program counter and the value of all program registers
• When processes are swapped out of CPU and later restored, additional information must also be stored and restored. Key among them are the program counter and the value of all program registers

Program vs Process Program is passive entity stored on disk executable file), process is active Program becomes process when a executable file loaded into memory Execution of program started via gul mouse clicks, command line entry of its name etc One program can be several processes Consider multiple users executing the same program
Program vs Process • Program is passive entity stored on disk (executable file), process is active • Program becomes process when a executable file loaded into memory • Execution of program started via GUI mouse clicks, command line entry of its name, etc • One program can be several processes • Consider multiple users executing the same program

Process state Processes may be in one of 5 states New- The process is in the stage of being created Ready- The process has all the resources available that it needs to run,but the CPU is not currently working on this process' s instructions Running -The CPu is working on this process's instructions Waiting - The process cannot run at the moment, because it is waiting for some resource to become available or for some event to occur. For example the process may be waiting for keyboard input, disk access request, inter process messages, a timer to go off, or a child process to finish Terminated The process has completed
- Process State • Processes may be in one of 5 states. • New - The process is in the stage of being created. • Ready - The process has all the resources available that it needs to run, but the CPU is not currently working on this process's instructions. • Running - The CPU is working on this process's instructions. • Waiting - The process cannot run at the moment, because it is waiting for some resource to become available or for some event to occur. For example the process may be waiting for keyboard input, disk access request, interprocess messages, a timer to go off, or a child process to finish. • Terminated - The process has completed

new admitted interrupt terminated ready running 10 or event completion scheduler dispatch 2I0 or event wait waitin Figure 3. 2-Diagram of process state
Figure 3.2 - Diagram of process state

DEMO Task manager in Windows °ps,top The load average reported by the w"command indicate the average number of processes in the "Ready state over the last 1, 5, and 15 minutes, i. e. processes who have everything they need to run but cannot because the Cpu is busy doing something else Some systems may have other states besides the ones listed here
• Task manager in Windows • ps, top • The load average reported by the "w" command indicate the average number of processes in the "Ready" state over the last 1, 5, and 15 minutes, i.e. processes who have everything they need to run but cannot because the CPU is busy doing something else. • Some systems may have other states besides the ones listed here

Process control block For each process there is a process Control Block, PCB process state · Process state- Running, waiting,… · Process id process number CPU registers and Program Counter- These need to be program counter saved and restored when swapping processes in and out of the cpu CPU-Scheduling information- Such as priority registers information and pointers to scheduling queues Memory-Management information-Eg page tables or segment tables memory limits Accounting information-user and kernel CPU time list of open files consumed, time limits, etc 1o Status information -Devices allocated, open file tables etc
- Process Control Block • For each process there is a Process Control Block, PCB • Process State - Running, waiting, …; • Process ID • CPU registers and Program Counter - These need to be saved and restored when swapping processes in and out of the CPU. • CPU-Scheduling information - Such as priority information and pointers to scheduling queues. • Memory-Management information - E.g. page tables or segment tables. • Accounting information - user and kernel CPU time consumed, time limits, etc. • I/O Status information - Devices allocated, open file tables, etc
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《大学计算机基础》课程教学资源(PPT课件讲稿)第四章 Excel 2007电子表格.ppt
- 东南大学:《C++语言程序设计》课程教学资源(PPT课件讲稿)Chapter 11 Operator Overloading; String and Array Objects(主讲:东方).ppt
- 《计算机网络》课程实验教学大纲.pdf
- 广西医科大学:《计算机网络 Computer Networking》课程教学资源(PPT课件讲稿)Chapter 18 NETWORK DESIGN AND IMPLEMENTATION.pptx
- 《多媒体技术基础》课程教学资源(PPT课件讲稿)单元1 多媒体概述.ppt
- 中国科学技术大学:《并行算法实践》课程教学资源(PPT课件讲稿)上篇 并行程序设计导论 单元I 并行程序设计基础 第三章 并行程序设计简介.ppt
- 《计算机控制技术》课程教学资源(PPT课件讲稿)第二章 模拟量输出通道.ppt
- 哈尔滨工业大学:开放式中文实体关系抽取研究(导师:秦兵).pptx
- 兰州大学:《SOA & Web Service》教学资源(PPT课件讲稿)Lecture 5 Web Service Program(苏伟).ppt
- 中国科学技术大学:《高级操作系统 Advanced Operating System》课程教学资源(PPT课件讲稿)第四章 分布式进程和处理机管理(主讲:熊焰).ppt
- 香港浸会大学:《网络管理 Network Management》课程教学资源(PPT课件讲稿)Chapter 02 Network Management Model.ppt
- 对等网络 Peer-to-Peer Networks(P2P).ppt
- Threads, SMP, and MicroKernels.ppt
- Object-Oriented Programming(Java).ppt
- 《编译原理》课程教学资源(PPT课件讲稿)第三章 语法分析.ppt
- 《操作系统》课程教学资源(PPT课件)第六章 设备管理 Devices Management.ppt
- 《计算机组装维修及实训教程》课程教学资源(PPT课件)第2章 中央处理器.ppt
- 《轻松学习C语言》教学资源(PPT课件讲稿,繁体版,共十二章).pptx
- 西安电子科技大学:《Mobile Programming》课程PPT教学课件(Android Programming)Lecture 7 数据持久化 Data Persistence.pptx
- 《数据结构》课程教学资源(PPT课件讲稿)第四章 串.ppt
- 电子科技大学:《汇编语言程序设计》课程教学资源(PPT课件)第一章 基础知识(主讲:詹瑾瑜).ppt
- 《数据库系统概论》课程教学资源(PPT课件讲稿)第六章 数据库设计.ppt
- 中国科学技术大学:《计算机体系结构》课程教学资源(PPT课件讲稿)MSI、MESI、分布式共享存储器体系结构、Models of Memory Consistency.pptx
- 《汇编语言》课程教学资源(PPT课件讲稿)第6章 子程序.ppt
- 中国科学技术大学:《网络信息安全 NETWORK SECURITY》课程教学资源(PPT课件讲稿)第二章 数据加密技术基础.ppt
- 北京大学:《软件需求工程》课程教学资源(PPT课件讲稿)第十章 软件需求开发与管理工具.ppt
- 《计算机组装与维修》课程教学资源(PPT课件讲稿)第十三章 局域网维护及常见故障处理.ppt
- 南京大学:《编译原理》课程教学资源(PPT课件讲稿)第四章 语法分析(戴新宇).pptx
- 北京大学:《高级编译技术 Advanced Compiler Techniques》课程教学资源(PPT课件讲稿)Introduction to Optimizations.ppt
- 香港大学:Data Analysis - Factors Potentially Affecting Development.pptx
- 西安电子科技大学:《操作系统 Operating Systems》课程教学资源(PPT课件讲稿)Chapter 06 文件系统 File Systems(主讲:高海昌).ppt
- 南京大学:《自然语言处理 Natural Language Processing(NLP)》课程教学资源(PPT课件讲稿)自然语言处理概述、基于规则(知识工程)的传统自然语言处理方法(理性方法).ppt
- 香港科技大学:片上网络(PPT讲稿)network-on-chip(NoC)NoC Building Blocks.pptx
- 《数据结构》课程教学资源(PPT课件讲稿)第五章 数组.ppt
- 语义网与本体(PPT讲稿)Semantic Web & Ontology(元数据 Metadata).ppt
- 软件开发环境与工具(PPT讲稿)Software development environment and tool.ppt
- 哈尔滨工业大学:逻辑斯蒂回归与最大熵(PPT课件讲稿).pptx
- 《机器学习》教学资源(PPT讲稿)支持向量机 support vector machines.ppt
- 中国科学技术大学:《计算机视觉》课程教学资源(PPT课件讲稿)第二章 视觉的基本知识.ppt
- 《编译原理》课程教学资源(PPT课件讲稿)第二章 词法分析.ppt