Chapter s Operating System 5.1.1 Resource allocation and related functions An os can use a resource table as the central 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 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 操作系统可以利用资源表作为资源分配的中心数据结构。表中包含系统的每一资源 单位项数据项中记录资源单位的名称或地址以及当前状态,即它是空闲的还是己经 分配给某一程序。当程序对某一资源提出请求后,若该资源是空闲的,则它将被分 配给那个程序。若系统中同一资源类中存在许多资源单位,程序的资源请求只指明 要求哪类资源而由操作系统检查该类中是否有可用的资源单位可以分配。 《第机语 5-12
Chapter 5 Operating System 计算机专业英语 5-12 An OS can use a resource table as the central 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 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. 操作系统可以利用资源表作为资源分配的中心数据结构。表中包含系统的每一资源 单位项数据项中记录资源单位的名称或地址以及当前状态,即它是空闲的还是己经 分配给某一程序。当程序对某一资源提出请求后,若该资源是空闲的,则它将被分 配给那个程序。若系统中同一资源类中存在许多资源单位,程序的资源请求只指明 要求哪类资源而由操作系统检查该类中是否有可用的资源单位可以分配。 5.1.1 Resource allocation and related functions
Chapter s Operating System 5.1.1 Resource 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, 2000 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 alocated to it 在资源分区分配中,操作系统依据系统中的资源数目和程序数目决定如何 进行资源分配。例如,操作系统可能会决定一个程序可以使用MB内存、 2000个磁盘块及1个监视器,这一系列资源可以作为一个分区。系统可以提 前定义出一系列这样的区,资源表中为每一资源区保存相应的数据项。当 新的程序开始时将分配给它一个可用的分区。 不第机专语 5-13
Chapter 5 Operating System 计算机专业英语 5-13 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, 2000 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. 在资源分区分配中,操作系统依据系统中的资源数目和程序数目决定如何 进行资源分配。例如,操作系统可能会决定一个程序可以使用1MB内存、 20O0个磁盘块及1个监视器,这一系列资源可以作为一个分区。系统可以提 前定义出一系列这样的区,资源表中为每一资源区保存相应的数据项。当 新的程序开始时将分配给它一个可用的分区。 5.1.1 Resource allocation and related functions
Chapter s Operating System 5.1.1 Resource allocation and related functions Resource preemption There are different ways in which resource can be shared by a set of programs. Some of these are: Sequential sharing o Concurrent sharing 资源抢占 资源被一系列程序分享可以有多种不同的方式,如: 申行共享 并行共亨 《什第机专出美语 5-14
Chapter 5 Operating System 计算机专业英语 5-14 Resource preemption There are different ways in which resource can be shared by a set of programs. Some of these are: •Sequential sharing •Concurrent sharing 资源抢占 资源被一系列程序分享可以有多种不同的方式,如: • 串行共享 • 并行共亨 5.1.1 Resource allocation and related functions
Chapter s Operating System 5.1.1 Resource allocation and related functions 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 concurrent 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. 在串行共享中,一个资源只能分配给一个程序,当资源被释放后,它在资 源表中被标记为“空闲”,这时它才能被分配给下一个程序。在并行共亨 中,两个以上的程序可以同时使用同样的资源。并行共享的例子是数据文 件,其他资源通常不能被并行共享。在本文中以后若无特殊说明,所有资源 都被假设为只能串行共享。 《什第机美语 5-15
Chapter 5 Operating System 计算机专业英语 5-15 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 concurrent 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. 在串行共享中,一个资源只能分配给一个程序,当资源被释放后,它在资 源表中被标记为“空闲”,这时它才能被分配给下一个程序。在并行共亨 中,两个以上的程序可以同时使用同样的资源。并行共享的例子是数据文 件,其他资源通常不能被并行共享。在本文中以后若无特殊说明,所有资源 都被假设为只能串行共享。 5.1.1 Resource allocation and related functions
Chapter s Operating System 5.1.1 Resource allocation and related functions When a resource is sequentially shareable, the system can de allocate a resource when the program makes an explicit request for de-allocation. Alternatively, it can de-allocate a resource by force. This is called resource preemption, that is, forceful de- allocation of a resource 当资源可以串行共享时,系统可以在程序明确地提出释放分配 的请求后,对资源进行释放。或者,系统也可强行释放资源 这称为资源抢占。 《什第机专出美语
Chapter 5 Operating System 计算机专业英语 5-16 When a resource is sequentially shareable, the system can deallocate a resource when the program makes an explicit request for de-allocation. Alternatively, it can de-allocate a resource by force. This is called resource preemption, that is, forceful deallocation of a resource. 当资源可以串行共享时,系统可以在程序明确地提出释放分配 的请求后,对资源进行释放。或者,系统也可强行释放资源, 这称为资源抢占。 5.1.1 Resource allocation and related functions