操作系统设计及实现(第二章).ppt

  1. 1、本文档共113页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
操作系统 设计与实现 Chapter 2 Processes *The importance of process in an operating system 2.1 Introduction to processes *common Parallelism==Pseudoparallelism *It is the cpu rapid switching back and forth *multiprocessor is the real parallelism *people design a model , sequential processes 顺序进程 2.1.1 The process model Characters: * All the runnable software are organized into a number of sequential processes; (in this chapter we called it processes) * The process is an executing program; The process include the values of the all the program counter, registers,and variables;(进程包括程序计数器、寄存器和变量的当前值。) To these characters , it is easy to analysis the collection of the processes than keep track the rapid switch of CPU Process---Program Process is an executing program, it has program, input, output, and state. An example: scientist prepare the cake for his daughter. Recipe: /resipi/ 食谱 **** A Process is an activity of some kind, It has a program ,input, output, and a state, A single processor may be shared among several processes, with some scheduling algorithm being used to determine when to stop work on one process and service a different one. 理解进程和程序的区别: CPU:计算机科学家 程序1:烘制生日蛋糕的食谱 数据:面粉、鸡蛋、糖和香草汁等 对应的进程1:阅读食谱、取来各种原料以及烘制蛋糕的一系列动作的总和。 事件:女儿被蜜蜂螫伤 保存进程1的当前状态:计算机科学家就记录下自己照着食谱做到哪儿了。 程序2:急救手册 数据:药物等 对应的进程2:实施医疗救治(高优先级进程) 当蜜蜂螫伤处理完之后,计算机科学家又回来做蛋糕,从他离开时的那一步继续做下去。 进程的创建 系统初始化 (1) 前台进程:同用户交互并替它们完成工作的哪些进程。 (2) 后台进程:守护进程,处理网页、打印之类活动的进程。 2.正在运行的一个进程执行了创建进程的系统调用。 3.用户请求创建一个新进程。 在交互式系统中,用户可以通过键入命令启动程序。 4. 批处理作业的初始化 在操作系统认为有资源运行另一个作业时,它创建一个新的进程,并运行其输入队列中的一个作业。 进程的终止 正常退出:多数进程由于完成了它们的工作而终止。 出错退出(自愿):进程发现了严重错误。 严重错误(非自愿):通常是由于程序中的错误所致。例如,执行了一条非法指令,引用了不存在的内存,或除数是零。 被其它进程杀死:当一个进程终止时,由该进程所创建的所有进程也都立即被杀死。 Process hierarchies Any OS, to support process, it must provide some way to create all the processes needed. Use fork( ) to create a new process, the father process can create his child processes,0~~~more, and later ,the pr

您可能关注的文档

文档评论(0)

kehan123 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档