《计算机专业英语》谢希仁第二版-第5章讲义.ppt
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《《计算机专业英语》谢希仁第二版-第5章讲义.ppt》由会员分享,可在线阅读,更多相关《《计算机专业英语》谢希仁第二版-第5章讲义.ppt(54页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、计算机算机专业英英语谢希仁第二希仁第二版版-第第5章章讲义Key points:Function and structure of Operating SystemDifficult points:Resource allocation and related functions User interface functions Requirements:1.了解操作系统是如何实现资源分配和用户接口功了解操作系统是如何实现资源分配和用户接口功能的。能的。2.通过学习操作系统功能的演化,认识操作系统在通过学习操作系统功能的演化,认识操作系统在实现过程中采用的基本概念与技术,了解操作系实现过程中采
2、用的基本概念与技术,了解操作系统设计中的概念。统设计中的概念。3.认识操作系统的结构,了解当前常见操作系统的认识操作系统的结构,了解当前常见操作系统的特点特点4.掌握被动语态的翻译技巧。掌握被动语态的翻译技巧。New Words&Expressions:allocation n.分配分配,安置安置interface n.界面,接口界面,接口binding n.捆绑,绑定捆绑,绑定 mutual interference 相互干扰相互干扰entrust v.委托委托criteria n.标准标准 constraint n.约束约束,强制强制,局促局促partition vt.分区分区aprior
3、i 预先预先,事前事前perceive v.感知感知,感到感到,认识到认识到suboptimal adj.未达最佳标准的未达最佳标准的preemption n.抢占抢占sequential adj.顺序的顺序的,串行的串行的concurrent adj.并发的并发的,并行的并行的exclusive use 专用专用de-allocate vt.释放释放 scheduling n.调度调度salient adj.重要的,显著的重要的,显著的5.1 OS Function OS functions can be classified intoResource allocation and rela
4、ted functionsUser interface functions.The resource allocation function implements resource sharing by the users of a computer system.Basically,it performs binding of a set of resources with a requesting program,that is,it associates resources with a program.The related functions implement protection
5、 of users sharing a set of resources against mutual interference.操作系统的功能可分为操作系统的功能可分为:1.资源分配及相关功能。资源分配及相关功能。2.用户接口功能用户接口功能资源分配功能负责实现计算机系统的用户共享资源。它主要将资源资源分配功能负责实现计算机系统的用户共享资源。它主要将资源和提出需求的程序绑定在一起和提出需求的程序绑定在一起,即使资源和程序相关联。与之相关的即使资源和程序相关联。与之相关的一些功能实现不同用户在共享资源时的保护,以免发生相互干扰。一些功能实现不同用户在共享资源时的保护,以免发生相互干扰。5.1
6、 OS Function The user interface function facilitates creation and use of appropriate computational structures by a user.This function typically involves the use of a command language or a menu.用户接口功能帮助用户创立并使用适当的计算结构,这一功能通用户接口功能帮助用户创立并使用适当的计算结构,这一功能通常涉及命令语言或菜单的应用。常涉及命令语言或菜单的应用。5.1 OS Function The res
7、ource allocation function allocates resources for use by a users computation.Resources can be divided into system provided resources like CPUs,memory areas and IO devices,or user-created resources like files which are entrusted to the OS.资源分配功能分配资源供用户计算使用。资源可分为系统提供资源分配功能分配资源供用户计算使用。资源可分为系统提供的资源(如的资源
8、(如CPU、存储器区域及、存储器区域及I/O设备群)和用户创建的资设备群)和用户创建的资源(如由操作系统管理的文件等)。源(如由操作系统管理的文件等)。5.1.1 Resource allocation and related functions Resource allocation criteria depend on whether a resource is a system resource or a user-created resource.Allocation of system resources is driven by considerations of efficien
9、cy of resource utilization.Allocation of user-created resources is based on a set of constraints specified by its creator and typically embodies the notion of access privileges.资源分配的标准根据资源的分类确定,系统资源的分配要考虑资源分配的标准根据资源的分类确定,系统资源的分配要考虑资源利用的效率,而用户创立资源的分配则基于该资源的创立资源利用的效率,而用户创立资源的分配则基于该资源的创立者所设定的特种限制,比如访问权
10、限。者所设定的特种限制,比如访问权限。5.1.1 Resource allocation and related functions Two popular strategies for resource allocation are:Partitioning of resources Allocation from a pool资源分配通常采取以下两种策略;资源分配通常采取以下两种策略;1.资源分区。资源分区。2.从资源池中分配。从资源池中分配。5.1.1 Resource allocation and related functions In the resource partitioni
11、ng approach,the OS decides a priori what resources should be allocated to a user computation.This approach is called static allocation because the allocation is made before the execution of a program starts.Static resource allocation is simple to implement,however,it could lead to suboptimal utiliza
12、tion because the allocation is made on the basis of perceived needs of a program,rather than its actual needs.在资源分区方式中,操作系统预先决定把哪些资源分配给某个在资源分区方式中,操作系统预先决定把哪些资源分配给某个用户计算使用,这种方法也称为静态分配,因为分配是在程序用户计算使用,这种方法也称为静态分配,因为分配是在程序执行前进行的。静态资源分配易于实现,但由于它不是从程序执行前进行的。静态资源分配易于实现,但由于它不是从程序的实际需要出发,而是根据程序预先提出的需求来做决定,所的
13、实际需要出发,而是根据程序预先提出的需求来做决定,所以容易导致系统利用率下降。以容易导致系统利用率下降。5.1.1 Resource allocation and related functions In the latter approach,the OS maintains a common pool of resources and allocates from this pool on a need basis.Thus,OS considers allocation of a resource when a program raises a request for a resourc
14、e.This approach is called dynamic allocation because the allocation takes place during the execution of a program.Dynamic resource allocation can lead to better utilization of resources because the allocation is made when a program requests a resource.在后一种分配方式中,操作系统维护一个公共资源池,并按照在后一种分配方式中,操作系统维护一个公共资
15、源池,并按照程序的需要对资源进行分配。这样,程序的需要对资源进行分配。这样,OS只在程序提出对一个资只在程序提出对一个资源的需求时才进行资源分配,这种方式也称为动态分配,因为源的需求时才进行资源分配,这种方式也称为动态分配,因为分配是在程序执行的过程中进行的。动态存储分配的资源利用分配是在程序执行的过程中进行的。动态存储分配的资源利用率较高,因为它是在程序需要资源时才进行分配。率较高,因为它是在程序需要资源时才进行分配。5.1.1 Resource allocation and related functions An OS can use a resource table as the ce
16、ntral data structure allocation.The table contains an entry for each resource unit in the system.The entry contains the name or address of the resource unit and its present status,i.e.whether it is free or allocated to some program.When a program raises a request for a resource,the resource would be
17、 allocated to it if it is presently free.If many resource units of a resource class exist in the system,a resource request only indicates the resource class and the OS checks if any resource unit of that class is available for allocation.操作系统可以利用资源表作为资源分配的中心数据结构。表中包含系统的每操作系统可以利用资源表作为资源分配的中心数据结构。表中包含
18、系统的每一资源单位项数据项中记录资源单位的名称或地址以及当前状态,即它是空一资源单位项数据项中记录资源单位的名称或地址以及当前状态,即它是空闲的还是己经分配给某一程序。当程序对某一资源提出请求后,若该资源是闲的还是己经分配给某一程序。当程序对某一资源提出请求后,若该资源是空闲的,则它将被分配给那个程序。若系统中同一资源类中存在许多资源单空闲的,则它将被分配给那个程序。若系统中同一资源类中存在许多资源单位,程序的资源请求只指明要求哪类资源而由操作系统检查该类中是否有可位,程序的资源请求只指明要求哪类资源而由操作系统检查该类中是否有可用的资源单位可以分配。用的资源单位可以分配。5.1.1 Reso
19、urce allocation and related functions In the partitioned resource allocation approach,the OS decides on the resources to be allocated to a program based on the number of resources and the number of programs in the system.For example,an OS may decide that a program can be allocated 1 MB of memory,200
20、0 disk blocks and a monitor.Such a collection of resources is referred to as a partition.In effect,a set of partitions can be predefined in the system.The resource table can have an entry for each resource partition.When a new program is to be started,an available partition is allocated to it.在资源分区分
21、配中,操作系统依据系统中的资源数目和程序数目决定如何进在资源分区分配中,操作系统依据系统中的资源数目和程序数目决定如何进行资源分配。例如,操作系统可能会决定一个程序可以使用行资源分配。例如,操作系统可能会决定一个程序可以使用1MB内存、内存、20O0个磁盘块及个磁盘块及1个监视器,这一系列资源可以作为一个分区。系统可以提个监视器,这一系列资源可以作为一个分区。系统可以提前定义出一系列这样的区,资源表中为每一资源区保存相应的数据项。当新前定义出一系列这样的区,资源表中为每一资源区保存相应的数据项。当新的程序开始时将分配给它一个可用的分区。的程序开始时将分配给它一个可用的分区。5.1.1 Reso
22、urce allocation and related functions Resource preemptionThere are different ways in which resource can be shared by a set of programs.Some of these are:Sequential sharingConcurrent sharing资源抢占资源抢占资源被一系列程序分享可以有多种不同的方式,如:资源被一系列程序分享可以有多种不同的方式,如:串行共享串行共享 并行共亨并行共亨5.1.1 Resource allocation and related fu
23、nctions In sequential sharing,a resource is allocated for exclusive use by a program.When the resource is de-allocated,it is marked free in the resource table.Now it can be allocated to another program.In concurrent sharing,two or more programs can concurrently use the same resource.Examples of conc
24、urrent sharing are data files.Most other resources cannot be shared concurrently.Unless otherwise mentioned,all through this text resources are assumed to be only sequentially shareable.在串行共享中,一个资源只能分配给一个程序,当资源被释放后,它在资源在串行共享中,一个资源只能分配给一个程序,当资源被释放后,它在资源表中被标记为表中被标记为“空闲空闲”,这时它才能被分配给下一个程序。在并行共亨中,这时它才能被分
25、配给下一个程序。在并行共亨中,两个以上的程序可以同时使用同样的资源。并行共享的例子是数据文件,其两个以上的程序可以同时使用同样的资源。并行共享的例子是数据文件,其他资源通常不能被并行共享。在本文中以后若无特殊说明他资源通常不能被并行共享。在本文中以后若无特殊说明,所有资源都被假所有资源都被假设为只能串行共享。设为只能串行共享。5.1.1 Resource allocation and related functions When a resource is sequentially shareable,the system can de-allocate a resource when the
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 计算机专业英语 计算机专业 英语 谢希仁 第二 讲义
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内