欢迎来到装配图网! | 帮助中心 装配图网zhuangpeitu.com!
装配图网
ImageVerifierCode 换一换
首页 装配图网 > 资源分类 > PPT文档下载
 

进程管理(英文课件).ppt

  • 资源ID:15497037       资源大小:422.50KB        全文页数:38页
  • 资源格式: PPT        下载积分:9.9积分
快捷下载 游客一键下载
会员登录下载
微信登录下载
三方登录下载: 微信开放平台登录 支付宝登录   QQ登录   微博登录  
二维码
微信扫一扫登录
下载资源需要9.9积分
邮箱/手机:
温馨提示:
用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
支付方式: 支付宝    微信支付   
验证码:   换一换

 
账号:
密码:
验证码:   换一换
  忘记密码?
    
友情提示
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

进程管理(英文课件).ppt

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 almost 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 computer 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 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 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 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 process.,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 without 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 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 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 Scheduling,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/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调度),Addition 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. 长程调度控制了多道程序的“道数” 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 state 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 of 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 process memory space with a new program.,A Tree of Processes On A Typical UNIX System,Process Termination,Process executes last statement and asks the operating system to delete it (exit). Process resources are deallocated by operating system. Output data from child to parent (via wait). Parent may terminate execution of children processes Child has exceeded超过 allocated resources. Task assigned to child is no longer required. Parent is exiting. Operating system does not allow child to continue if its parent terminates. Cascading termination. 级联终止,Cooperating Processes,Independent process cannot affect or be affected by the execution of another process. Cooperating process can affect or be affected by the execution of another process Advantages of process cooperation Information sharing Computation speed-up Modularity Convenience,Producer-Consumer Problem,Paradigm for cooperating processes, producer process produces information that is consumed by a consumer process. unbounded-buffer places no practical limit on the size of the buffer. 无界缓冲没有对缓冲区大小的限制 bounded-buffer assumes that there is a fixed buffer size. 有界缓冲对缓冲区大小作了限定,Bounded-Buffer Shared-Memory Solution,Shared data var n; type item = ; var buffer. array 0.n1 of item; in, out: 0.n1; Producer process repeat produce an item in nextp while in+1 mod n = out do no-op; buffer in :=nextp; in :=in+1 mod n; until false;,Bounded-Buffer (Cont.),Consumer process repeat while in = out do no-op; nextc := buffer out; out := out+1 mod n; consume the item in nextc until false; Solution is correct, but can only fill up n1 buffer.,Threads,A thread (or lightweight process) is a basic unit of CPU utilization; it consists of: program counter register set stack space A thread shares with its peer threads its: code section data section operating-system resources collectively know as a task. 整体作为一个任务,Threads (Cont.),In a multiple threaded task, while one server thread is blocked and waiting, a second thread in the same task can run. Cooperation of multiple threads in same job confers higher throughput and improved performance. Applications that require sharing a common buffer (i.e., producer-consumer) benefit from thread utilization. Threads provide a mechanism that allows sequential processes to make blocking system calls while also achieving parallelism. Kernel-supported threads (Mach and OS/2). User-level threads; supported above the kernel, via a set of library calls at the user level. Hybrid approach implements both user-level and kernel-supported threads (Solaris 2). 混合处理实现用户级和内核支持线程,Interprocess Communication-IPC,Mechanism for processes to communicate and to synchronize their actions. Message system processes communicate with each other without resorting to shared variables. IPC facility provides two operations send(message) message size fixed or variable receive(message) If P and Q wish to communicate, they need to : establish a communication link between them exchange messages via send/receive Implementation of communication link physical (e.g., shared memory, hardware bus) logical (e.g., logical properties),Implementation Questions,How are links established? Can a link be associated with more than two processes? How many links can there be between every pair of communicating processes? What is the capacity of a link? ? Is the size of a message that the link can accommodate fixed or variable? Is a link unidirectional or bi-directional?,Direct Communication,Processes must name each other explicitly显式: send (P, message) send a message to process P receive(Q, message) receive a message from process Q Properties of communication link Links are established automatically. A link is associated with exactly one pair of communicating processes. Between each pair there exists exactly one link. The link may be unidirectional, but is usually bi-directional.,Indirect Communication,Messages are directed and received from mailboxes. Each mailbox has a unique id. Processes can communicate only if they share a mailbox. Properties of communication link Link established only if processes share a common mailbox A link may be associated with many processes. Each pair of processes may share several communication links. Link may be unidirectional. al or bi-directional. Operations create a new mailbox send and receive messages through mailbox destroy a mailbox,Types of Mailbox,Private Mailbox: owner-Receive other user-Send Public Mailbox: owned by OS Shared Mailbox: created by a process, the ownership and privilege be passed to other processes,Synchronization,Blocking send:sender blocked until the message is received Nonblocking send:send the message and resume operation Blocking receive:receiver blocked until a message is available Nonblocking receive:receiver retrieves either a valid message or null,Buffering,Queue of messages attached to the link; implemented in one of three ways. 1.Zero capacity 0 messages Sender must wait for receiver. 2.Bounded capacity finite length of n messages Sender must wait if link full. 3.Unbounded capacity infinite length Sender never waits.,Exception Conditions Error Recovery,Process terminates 进程终止 Lost messages 消息丢失 Scrambled Messages 消息受损,Homework,P113 4.1 4.4 4.6,

注意事项

本文(进程管理(英文课件).ppt)为本站会员(za****8)主动上传,装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知装配图网(点击联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!