《进程管理英》PPT课件.ppt
《《进程管理英》PPT课件.ppt》由会员分享,可在线阅读,更多相关《《进程管理英》PPT课件.ppt(38页珍藏版)》请在三一办公上搜索。
1、Chapter 4:Processes,Process ConceptProcess SchedulingOperation on ProcessesCooperating ProcessesInterprocess Communication,Process Concept,An operating system executes a variety of programs:Batch system jobsTime-shared systems user programs or tasksTextbook uses the terms job and process almost inte
2、rchangeably.Process a program in executionA process includes:program counterstack data section,Process Concept,国内学术界较为一致的定义:进程是一个具有一定独立功能的程序,关于某个数据集合的一次可以并发执行的运行活动。From Wikipedia In computing,a process is an instance of a computer program that is being sequentially executed by a computer system that
3、 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 multiprogramming a
4、nd 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 processorSimultaneously(or paral
5、lel)is used to refer to several processes,each with their own processor.,Process vs.Program,Dynamic/staticprocess is a program in execution,so it is dynamic,program is a passive collection of instuctions,so it is a static entity.Lify cycleprocess has a life cycle.It is an active entity in the sense
6、that it can be created,executed,and terminated during its lifetime.Program can exist forever.Structureprocess=program+data+PCBEach process is represented in the OS by a process control block(PCB),it contains all information associated with a specific process.,Process vs.Program,No one-to-one mapping
7、 between processes and programscan have mulitple processes of the same programone process can invoke multiple programsProcess is the basic unit of being scheduled and resource allocation from the viewpoint of OS,while program can not be run without process creation.Process can be executed concurrent
8、ly or simultaneously.,Process State,As a process executes,it changes statenew: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 exe
9、cution.,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 counterCPU registers CPU scheduling informationMemory-management informationAccounting infor
10、mationI/O status information,Process Control Block(PCB),CPU Switch From Process to Process,Chapter 4:Processes,Process ConceptProcess SchedulingOperation on ProcessesCooperating ProcessesInterprocess Communication,Process Scheduling,Process Scheduling QueuesJob queue set of all processes in the syst
11、em.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/O Device Queues,Representation of Process Scheduling,Schedulers,Long-term schedule
12、r(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调度),Addition of Medium Term Scheduling,Schedulers(Cont.),Short-term scheduler is invoked very fr
13、equently(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.长程调度控制了多道程序的“道数”Processes can be described as either:I/O-bound process spends more time doing I/O than comput
14、ations,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 state of the old process and load the saved state for the new process.Context-switch time is overhead;the sys
15、tem 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 of processes.Resource sharingParent and children share all resources.Children share subset of parents resources.P
16、arent and child share no resources.ExecutionParent and children execute concurrently.Parent waits until children terminate.,Process Creation(Cont.),Address spaceChild duplicate of parent.Child has a program loaded into it.UNIX examplesfork system call creates new processexeclp system call used after
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 进程管理英 进程 管理 PPT 课件
链接地址:https://www.31ppt.com/p-5611276.html