1 / 92

简  介 Introduction 实 时 性 Real Time 资源管理 Resource Management 进程管理 Process Management

第 9 章 多媒体操作系统. 简  介 Introduction 实 时 性 Real Time 资源管理 Resource Management 进程管理 Process Management 文件系统 File Systems. 简 介. 操作系统是计算机硬件的外层,控制和管理计算机硬件资源,为程序的执行提供合适的环境,保证有效利用计算机的硬件。操作系统提供与计算机关键资源(如 CPU 、内存、外存储器和所有输入输出设备)相关的各种服务。.

tamarr
Download Presentation

简  介 Introduction 实 时 性 Real Time 资源管理 Resource Management 进程管理 Process Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 第9章 多媒体操作系统 • 简  介 Introduction • 实 时 性Real Time • 资源管理 Resource Management • 进程管理Process Management • 文件系统 File Systems

  2. 简 介 • 操作系统是计算机硬件的外层,控制和管理计算机硬件资源,为程序的执行提供合适的环境,保证有效利用计算机的硬件。操作系统提供与计算机关键资源(如CPU、内存、外存储器和所有输入输出设备)相关的各种服务。 • The operating system is the shield of the computer hareware against all software components.It provides a comfortable environment for the execution of programs,and it ensures effective utilization of the computer hardware.The operating system offers various services related to the essential resources of a computer:CPU,main memory,storage and all input and output devices.

  3. 连续媒体数据的实时处理是多媒体操作系统必须提供的一项重要功能。进程管理必须考虑到多媒体数据处理的时序要求。连续媒体数据的实时处理是多媒体操作系统必须提供的一项重要功能。进程管理必须考虑到多媒体数据处理的时序要求。 • The major aspect in this context is real-time processing of continuous media data.Process management must take into account the timing requirements imposed by the handling of multimedia data.

  4. 各个进程之间的通信和同步必须满足延迟要求的数据访问功能和有效的数据处理功能。例如,必须避免费时的物理数据拷贝操作,而应该使用缓冲区管理操作(通信系统中有时也要用到经类操作)。各个进程之间的通信和同步必须满足延迟要求的数据访问功能和有效的数据处理功能。例如,必须避免费时的物理数据拷贝操作,而应该使用缓冲区管理操作(通信系统中有时也要用到经类操作)。 • In mutlimedia systems,memory management has to provide access to data with a guaranteed timing delay and efficient data manipulation function.For instance,physical data copy operations must be avoided due to their negative impact on performance; buffer management operations(such as are known from communication systems)should be used.

  5. 数据库管理是多媒体系统中的重要部分,它对辅助存储器上的数据保存以及管理操作进行抽象。因此,数据库管理必依赖于由多媒体操作系统提供的文件管理设施以访问各个文件和文件系统。数据库管理是多媒体系统中的重要部分,它对辅助存储器上的数据保存以及管理操作进行抽象。因此,数据库管理必依赖于由多媒体操作系统提供的文件管理设施以访问各个文件和文件系统。 • Database management is an important component in smultimedia systems.However,database management abstracts the datails of storing data on secondary mediastorage.Therefore,database management should rely on file management services provided by the multimedia operating system to access single files and file systems.

  6. “实时”的定义 • 德国国家标准研究所(German National Institute Standardization,简称DIN,与美国ANSI类似)把计算机系统中的实时进程作了如下定义: • 实时进程是指在给定时间段内给出处理结果的进程。 • The German National Institute for Standardization,DIN,similar to the American ANSI,defines a real-time process in a computer system as follows: • A real-time process is a process which delivers the results of the processing in a given time-span.

  7. 实时系统的主要特征是计算的正确性,这种正确性不仅指计算结果,而且应在时间约束之内完成计算[SR89]。实时系统的主要特征是计算的正确性,这种正确性不仅指计算结果,而且应在时间约束之内完成计算[SR89]。 • The main characteristic of real-time systems is the correctness of the computation.This correctness does not only to errorless computation,but also on the time in which the result is presented[SR89].

  8. 因此,实时系统不仅出现大量硬件或软件错误时会失败,而且在系统无法按时完成时完成关键任务时也会失败[KL91]。如果系统的行为比较确定,那么在处理数据时通常能满足时间约束。因此,实时系统不仅出现大量硬件或软件错误时会失败,而且在系统无法按时完成时完成关键任务时也会失败[KL91]。如果系统的行为比较确定,那么在处理数据时通常能满足时间约束。 • Hence,a real-time system can fail not only if massive hardware or software failures occur,but also if the system is unable to execute its critical workload in time [KL91].Deterministic behavior of the system refers to the adherence of time spans defined in advance for the manipulation of data,i.e.,meeting a guaranteed response time.

  9. 最后期限 • 最后期限(deadline)是指表现处理结果的最迟可以接受时间,用它可以判断处理动作的正确与否。实时系统有软实时和硬实时之分。 • A deadline represents the latest acceptable time for the presentation of a processing result.It marks the border between normal(correct) and anomalous • (failing) behavior.A real-time system has both hard and soft deadlines.

  10. 实时系统的特征 • 实时系统必须具有确定性和可预测性的行为,并要求处理过程能满足限时任务的时间要求。显然,对于那些以随机概率发生的事件,它们就无法保证限时或最后期限要求。 • The necessity of deterministic and predictable behavior of real-time systems requires processing guarantees for time-critical tasks.Such guarantees cannot be assured for events that occur at random intervals with unknown arrival times,processing requirements or deadline.

  11. 实时系统的特征 • 另外,在实时进程执行期间,处理机本身不能失败,否则根本无法满足实时系统的实时要求。实时系统有如下特征[SR89]: • Further,all guarantees are valid only under the premise that no processing machine collapses during the run-time of real-time processes.A real-time system is distinguished by the following features(c.f.[SR89]):

  12. 能对限时事件进行预期的快速响应,并且有精确的时序信息。例如,在核电厂的控制系统中,如果出现错误,那么应能在非常短的时间人给予响应,从而避免造成灾难性事故。 • Predictably fast response to time-critical events and accurate timing information.For example,in the control system of a nuclear power plant,the response to a malfunction must occur within a well-defined period to aviod a potential disaster.

  13. 高度可调度性。调度性是指能根据实时系统的实时要求特征来有效地利用资源,从而使系统在最后期限前完成指定的操作。高度可调度性。调度性是指能根据实时系统的实时要求特征来有效地利用资源,从而使系统在最后期限前完成指定的操作。 • A high degree of schedulability.Schedulability refers to the degree of resource utilization at which,or below which,the deadline of each time-critical task can be taken into account.

  14. 短暂超负荷情况下的稳定性。如果出现短暂的超负荷,系统应不失败,并保证具有限时要求的任务顺利完成,这些任务对系统提供的基本功能是至关重要的。短暂超负荷情况下的稳定性。如果出现短暂的超负荷,系统应不失败,并保证具有限时要求的任务顺利完成,这些任务对系统提供的基本功能是至关重要的。 • Stability under transient overload.Under system overload,the processing of critical tasks must be ensured.These critical tasks are vital to the basic functionality provided by the system.

  15. 实时和多媒体 • 音频和视频数据流由单个、周期性变化的连续媒体数据(如音频样本或视频帧)组成。每个逻辑数据单元(LDU,logical data unit)必须按规定的时序输出到用户的计算机上,抖动(jitter)必须按规定的进输出到用户之前。 • Audio and video data streams consist of single,periodically changing values of continuous media data,e.g.,audio samples or video frames.Each logical Data Unit(LDU) must be presented by a well-determined deadline.Jitter is only allowed before the final presentation to the user.

  16. 例如,音乐必须按一种固定的速率在计算机中播放。要使用户以自然、无失真的方式感知这些媒体,例如,音乐必须按一种固定的速率在计算机中播放。要使用户以自然、无失真的方式感知这些媒体, • A piece of music,for example,must be played back at a constant speed.To fulfill the timing requirements of continuous media,the operating system must use real-time scheduling techniques,

  17. 操作系统必须将实时调度技术应用于和连续媒体数据处理有关的所有系统资源,即涉及端到端的整个数据路径——包括CPU、主存、存储器、I/O设备和网络。操作系统必须将实时调度技术应用于和连续媒体数据处理有关的所有系统资源,即涉及端到端的整个数据路径——包括CPU、主存、存储器、I/O设备和网络。 • These techniques must be applied to all system resources involved in the continuous media data processing,be applied to all system resources involved.The CPU is just one of these resources-all components must be considered including main memory,storage,I/O devices and networks.

  18. 资源管理器 • 多媒体系统中,数据通路上的每个硬件和软件成分必须满足连续媒体的定时要求,这种实际需求依赖于媒体的类型和所支持的应用系统的特性[SM92a]。 • In a multimedia system,the given timing guarantees for the processing of continuous media must be adhered to by every hardware and software system component along the data path.The actual requirements depend on the type of media and the nature of the applications supported[SM92a].

  19. 例如,当通信系统忙于处理来自数据库管理系统的事务时,应尽量传送视频图像。例如,当通信系统忙于处理来自数据库管理系统的事务时,应尽量传送视频图像。 • For example,a video image should not be presented late beacause the communication system has been busy with a transaction from a database management system.

  20. 在实际应用系统中常常碰到几个多媒体应用程序并发使用共享资源的情况,因此,即使有高带宽网络和巨大的处理。在实际应用系统中常常碰到几个多媒体应用程序并发使用共享资源的情况,因此,即使有高带宽网络和巨大的处理。 • In any realistic scenario we encounter several multimedia applications which concurrently make use of shared resources.Hence,even high bandwidth networks and huge processing capabilities require the use of real-time mechanisms to provide guaranteed data delivery.

  21. 资源 •  资源是处理数据的任务所要求的系统实体,用如下分类的不同特征描述: • A resource is a system entity required by tasks for manipulating data.Each resource has a set of distinguishing characteristics classified using the following scheme:

  22. 资源可以是主动的或被动的,主动资源有CPU和进行协议处理的网络适配器,它们提供服务;被动资源有主存、通信带宽或文件系统,它们代表主动所要求的系统能力。资源可以是主动的或被动的,主动资源有CPU和进行协议处理的网络适配器,它们提供服务;被动资源有主存、通信带宽或文件系统,它们代表主动所要求的系统能力。 • A resource can be active or passive.An active resource is the CPU or a network adapter for protocol processing;it provides a service.A passive resource is the main memory, communication bandwidth or a file system(whenever we do not take care of the processing of the adapter);it denotes some system capability required by active resources.

  23. 资源可以是一个进程独占使用或者多个进程共享使用。主动资源常常是独占的;被动资源通常可以在多个进程共享。 • A resource can be either used exclusively by one process at a time or shared between various processes.Active resources are often exclusive;passive resources can usually be shared among processes.

  24. 系统中只有一个的资源叫做单重资源,否则叫做重资源。在一个基于交换的多处理器系统中,CPU是一种多重资源。系统中只有一个的资源叫做单重资源,否则叫做重资源。在一个基于交换的多处理器系统中,CPU是一种多重资源。 • A resource that exists only once in the system is known as a single,otherwise it is multiple resource.In a transputer-based multiprocessor system,the individual CPU is a multiple resource.

  25. 需求 • 多媒体应用程序和数据流的需求要由多媒体系统中各部件来提供服务,资源管理将这些需求映射成各种容量。 • The requirements of multimedia applications and data streams must be served by the single components of a multimedia system.The resource management maps these requirements onto the respective capacity.

  26. 本地和分布式多媒体应用程序的传输和处理需求可以如下一组服务质量参数(QoS)来说明:本地和分布式多媒体应用程序的传输和处理需求可以如下一组服务质量参数(QoS)来说明: • The transmission and processing requirements of local and distributed multimedia applications can be specified according to the following characteristics:

  27. 吞吐量就是满足应用程序所需连接的数据位率,它也依赖于数据单元的大小。吞吐量就是满足应用程序所需连接的数据位率,它也依赖于数据单元的大小。 • 局部和全局(端-端)延迟分别为: • The throughput is determined by the needed data rate of a connection to satisfy the application requirements.It also depends on the size of the data units. • We distinguish between local and global(end-to-end) delay:

  28. ①“资源”延迟是该资源完成某一任务所需的最大时间跨度。 (a)The delay “at the resource” is the maximun time span for the completion of a certain task at this resource.

  29. ②“端-端”延迟是一个数据单元从源传输到目标的总延迟。例如,一个视频电话的源是摄像机,目标是对方屏幕上的视频窗口。 (b)The end-to-end delay is the total delay for a data unit to be transmitted from the source to its destination.For example,the source of a video telephone is the camers,the destination is the video window on the screen of the partner.

  30. 3.抖动(匮称延迟抖动)指的是数据到达目的地所需时间的最大偏差。 3.The jitter (or delay jitter) determines the maximum allowed variance in the arrival of data at the destination.

  31. (4)可靠性指的是多媒体任务传输和处理中所使用的错误检测和校正机制。错误可以被忽略、指出或校正。(4)可靠性指的是多媒体任务传输和处理中所使用的错误检测和校正机制。错误可以被忽略、指出或校正。 (4)The reliability defines error detection and correction mechanisms used for the transmission and processing of multimedia tasks.Errors can be ignored,indicated and/or corrected.

  32. 值得注意的是,通过重新传输来进行错误校正对于限时任务一般是不合适的,因为重传输数据通常到达较迟。值得注意的是,通过重新传输来进行错误校正对于限时任务一般是不合适的,因为重传输数据通常到达较迟。 • It is important to notice that error correction through re-transmission is rarely appropriate for time-critical data beacause the retransmitted data will usually arrive late.

  33. 组件和步骤 • 资源分配和管理的一个可能实现方案是基于客户和各资源管理器之间的交互。客户选择资源并通过一个QoS说明来指出其需求,从而请求一次资源分配。 • One possible realization of resource allocation and management is based on the interaction between clients and their respective resource management.The client selects the resource and requests a resource allocation by specifying its requirements through a QOS specification.

  34. 资源管理器首先检查自己的资源利用率,决定对预留请求服务响应与否。把所有已存在的保留和请求保存起来.资源管理器首先检查自己的资源利用率,决定对预留请求服务响应与否。把所有已存在的保留和请求保存起来. • This is equivalent to a workload request.First,the resource manager checks its own resource utilization and decides if the reservation request can be served or not.All existing reservation are stored.

  35. 这样就保证了它们对各资源容量的共享。而且必要的话,该部件与其他资源管理器协商保留请求。这样就保证了它们对各资源容量的共享。而且必要的话,该部件与其他资源管理器协商保留请求。 • This way,their share in terms of the respective resource capacity is guaranteed.Moreover,this component negotiates the reservation request with other resource managers,if necessary.

  36. Users Server Station Frame Grabber & Encoder Presentation In a Window Compression Decompression Communication Transport & Network Layer Communication Transport & Network Layer Data Link & Network Adapter Data Link & NetworkAdapter Network(s) Figure 9.2:Components grouped for the purpose of video data transmission

  37. 分配机制 • 资源预留可以采用悲观或乐观的方法: • 在悲观方法中按最坏情况预留以避免资源冲突,即预订一个任务可能需要的最长处理时间和最 高速率的资源带宽。 • Reservation of resource can be made either in a pessimistic or optimistic way: • The pessimistic approach avoids resource conflicts by making reservations for the worst case,i.e.,resource bandwidth for the longest processing time and the highest rate which might ever be needed by a task is reserved.Resource conflicts are therefore avoided.

  38. 这直接导致了资源利用率低。在一个多媒体系统中,剩余的处理器时间可由离散媒体任务使用,该办法能保证QsS。这直接导致了资源利用率低。在一个多媒体系统中,剩余的处理器时间可由离散媒体任务使用,该办法能保证QsS。 • This leads potentially to an underutilization of resources.In a multimedia system,the remaining processor time(i.e.,the time reserved for traffic but not used) can be used by discrete media tasks.This method results in a guaranteed QOS.

  39. 在乐观的方法中,资源仅根据平均工作负荷预留。QsS参数被尽可能满足,资源的利用率很高,但在过载时会引起失败。在乐观的方法中,资源仅根据平均工作负荷预留。QsS参数被尽可能满足,资源的利用率很高,但在过载时会引起失败。 • With the optimistic approach,resources are reserved according to an average workload only.QOS parameters are met as far as possible.Resourceare highly utilized,though an overload situation may result in failure.

  40. 为检测过载情况并对其作相应处理,可以实现一个监控进程,根据进程的重要性作抢占式中断处理。为检测过载情况并对其作相应处理,可以实现一个监控进程,根据进程的重要性作抢占式中断处理。 • To detect an overload situation and to handle it accordingly a monitor can be implemented.The monitor may,for instance,preempt processes according to their importance.

  41. 乐观方法认为是悲观方法的一个扩充,它需要额外的机制来检测和解决资源冲突。乐观方法认为是悲观方法的一个扩充,它需要额外的机制来检测和解决资源冲突。 • The optimistic approach is considered to be an extension of the pessimistic approach.It requires that additional mechanisms to detect and solve resource conflicts be implemented.

  42. 连续媒体资源模型 • 数据流由LDU组成,这里把它们称作消息。数据流本身具有周期性特征,不同流相互独立。 • The data stream consists of LDUs.In this context,we call them messages.The data stream itself is characterized as strictly periodic.Various data streams are independent of each other.

  43. 通过对操作系统中消息的仔细研究,可以发现它们产生的速率不一样。数据速率的变化将会导致消息突发,为了避免消息阻塞,通常对所允许的最大消息进行规定。通过对操作系统中消息的仔细研究,可以发现它们产生的速率不一样。数据速率的变化将会导致消息突发,为了避免消息阻塞,通常对所允许的最大消息进行规定。 • A closer inspection shows a possible variance of the message rate,the maximum rate is well-defined.This variance of the data rate results in an accumulation of messages(burst),where the maximal range is defined by the maximum allowed number of messages.

  44. 在LBAP模型中,突发的消息由那些比原计划提前到达的消息组成。LBAP是一个消息到达进程,相应的资源由以下三个参数定义:在LBAP模型中,突发的消息由那些比原计划提前到达的消息组成。LBAP是一个消息到达进程,相应的资源由以下三个参数定义: • In the LBAP model,a burst of messages consists that arrived ahead of schedule.LBAP is a message arrival process at a resource defined by three parameters:

  45. M=最大消息大小(字节/消息) R=最大消息速率(消息/秒) B=最大突发(消息) M=Maximum message size (byte/message). R=Maximum message rate(message/second). B=Maximum Burstiness (message).

  46. 进程管理  • 进程是程序在一个数据集合上运行的过程,是系统进行资源和调度运行的一个独立单位。进程管理的主动功能就是把处理机分配给进程以及协调各个进程之间的相互的关系。一个实际系统中,存在有大量并活动的进程,进程之间是相互制约的,某一时刻只有一个进程获得处理机而得以运行。 • Process management deals with the resource main processor.The capacity of this resource is specified as processor capacity.The process manager maps single processes onto resources according to a specified scheuling policy such that all processes meet their requirements.

  47. 所以从进程管理的角度出发,可以将进程划分成空闲、阻塞、就绪和运行4种基本状态。进程在其生命周期内可以随着自身的推进和外界环境的变化而从一种状态变迁到另一种状态。所以从进程管理的角度出发,可以将进程划分成空闲、阻塞、就绪和运行4种基本状态。进程在其生命周期内可以随着自身的推进和外界环境的变化而从一种状态变迁到另一种状态。 • In most systems,a process under control of the process manager can adopt one of the following states:

  48. 空闲状态:在初始状态时,没有进程赋给程序,这时的进程就处于空闲状态。空闲状态:在初始状态时,没有进程赋给程序,这时的进程就处于空闲状态。 • 阻塞状态:进程等待某一事件完成而暂时不能运行的状态,处于这种状态的进程不能参加竞争处理机。 • In the initial state,no process is assigned to the program.The process is in the idle state. • If a process is waiting for an event,i.e.,the process lacks one of the necessary resources for processing,it is in the blocked state.

  49. 就绪状态:进程运行所需的资源都得到了满足,一旦获得处理机就立即投入运行。就绪状态:进程运行所需的资源都得到了满足,一旦获得处理机就立即投入运行。 • 运行状态:进程获得必要资源垢正在处理机上运行的状态。 • If all necessary resources are assigned to the process,it is ready to run.The process only needs the processor for the execution of the program. • A process is running as long as the system processor is assigned to it.

More Related