进程管理(英文课件)

上传人:tia****nde 文档编号:70595151 上传时间:2019-01-17 格式:PPT 页数:38 大小:617.81KB
返回 下载 相关 举报
进程管理(英文课件)_第1页
第1页 / 共38页
进程管理(英文课件)_第2页
第2页 / 共38页
进程管理(英文课件)_第3页
第3页 / 共38页
进程管理(英文课件)_第4页
第4页 / 共38页
进程管理(英文课件)_第5页
第5页 / 共38页
点击查看更多>>
资源描述

《进程管理(英文课件)》由会员分享,可在线阅读,更多相关《进程管理(英文课件)(38页珍藏版)》请在金锄头文库上搜索。

1、Chapter 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 alm

2、ost interchangeably. Process a program in execution A process includes: program counter stack data section,Process Concept,国内学术界较为一致的定义: 进程是一个具有一定独立功能的程序,关于某个数据集合的一次可以并发执行的运行活动。 From Wikipedia In computing, a process is an instance of a computer program that is being sequentially executed by a compu

3、ter system that has the ability to run several computer programs concurrently.,Process Concept,A single computer processor executes one or more instructions at a time (per clock cycle), one after the other. To allow users to run several programs at once, single-processor computer systems can perform

4、 multiprogramming and time-sharing. Using more than one physical processor on a computer, permits true simultaneous execution of more than one stream of instructions from different processes. Concurrency is the term generally used to refer to several independent processes sharing a single processor

5、Simultaneously (or parallel) is used to refer to several processes, each with their own processor.,Process vs. Program,Dynamic/static process is a program in execution, so it is dynamic, program is a passive collection of instuctions, so it is a static entity. Lify cycle process has a life cycle. It

6、 is an active entity in the sense that it can be created, executed, and terminated during its lifetime. Program can exist forever. Structure process = program + data + PCB Each process is represented in the OS by a process control block (PCB), it contains all information associated with a specific p

7、rocess.,Process vs. Program,No one-to-one mapping between processes and programs can have mulitple processes of the same program one process can invoke multiple programs Process is the basic unit of being scheduled and resource allocation from the viewpoint of OS, while program can not be run withou

8、t process creation. Process can be executed concurrently or simultaneously.,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

9、assigned to a processor. terminated: The process has finished execution.,Diagram of Process State,admitted,I/O or event completion,scheduler dispatch,I/O or event wait,interrupt,exit,Process Control Block (PCB),Information associated with each process: Process state Program counter CPU registers CPU

10、 scheduling information Memory-management information Accounting information I/O status information,Process Control Block (PCB),CPU Switch From Process to Process,Chapter 4: Processes,Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication,Process S

11、cheduling,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. Process migration between the various queues.,Ready Queue And Various I/

12、O Device Queues,Representation of Process Scheduling,Schedulers,Long-term scheduler (or job scheduler) selects which processes should be brought into the ready queue. 长程调度(或作业调度) Short-term scheduler (or CPU scheduler) selects which process should be executed next and allocates CPU. 短程调度(或CPU调度),Add

13、ition of Medium Term Scheduling,Schedulers (Cont.),Short-term scheduler is invoked very frequently (milliseconds) (must be fast). 调用频率高 Long-term scheduler is invoked very infrequently (seconds, minutes) (may be slow). 调用频率不高 The long-term scheduler controls the degree of multiprogramming. 长程调度控制了多道

14、程序的“道数” Processes can be described as either: I/O-bound process spends more time doing I/O than computations, many short CPU bursts. CPU-bound process spends more time doing computations; few very long CPU bursts.,Context Switch上下文切换,When CPU switches to another process, the system must save the sta

15、te of the old process and load the saved state for the new process. Context-switch time is overhead; the system does no useful work while switching. Time dependent on hardware support.,Process Creation,Parent process creates children processes, which, in turn create other processes, forming a tree o

16、f processes. Resource sharing Parent and children share all resources. Children share subset of parents resources. Parent and child share no resources. Execution Parent and children execute concurrently. Parent waits until children terminate.,Process Creation (Cont.),Address space Child duplicate of parent. Child has a program loaded into it. UNIX examples fork system call creates new process execlp system call used after a fork to replace the p

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 高等教育 > 大学课件

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号