Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dr. M. Munlin Real-Time and Multimedia Systems 1 NETE0516 Operating Systems Instructor: ผ. ศ. ดร. หมัดอามีน หมัน หลิน Faculty of Information Science and.

Similar presentations


Presentation on theme: "Dr. M. Munlin Real-Time and Multimedia Systems 1 NETE0516 Operating Systems Instructor: ผ. ศ. ดร. หมัดอามีน หมัน หลิน Faculty of Information Science and."— Presentation transcript:

1 Dr. M. Munlin Real-Time and Multimedia Systems 1 NETE0516 Operating Systems Instructor: ผ. ศ. ดร. หมัดอามีน หมัน หลิน Faculty of Information Science and Technology Mahanakorn University of Technology Email: mmunlin@gmail.com Real-Time and Multimedia Systems Lecture#15

2 Dr. M. Munlin Real-Time and Multimedia Systems 2 Objectives To explain the timing requirements of real-time systems To discuss the defining characteristics of real-time systems To describe scheduling algorithms for hard real-time systems To identify the characteristics of multimedia data To examine several algorithms used to compress multimedia data To explore the operating system requirements of multimedia data, including CPU and disk scheduling and network management

3 Dr. M. Munlin Real-Time and Multimedia Systems 3 Topics Features of Real-Time Systems Implementing Real-Time Operating Systems Real-Time CPU Scheduling VxWorks 5.x Multimedia Streaming Compression Techniques QoS An Example: Tiger Video Server

4 Dr. M. Munlin Real-Time and Multimedia Systems 4 Overview of Real-Time Systems A real-time system requires that results be produced within a specified deadline period. An embedded system is a computing device that is part of a larger system (I.e. automobile, airliner.) A safety-critical system is a real-time system with catastrophic results in case of failure. A hard real-time system guarantees that real-time tasks be completed within their required deadlines. A soft real-time system provides priority of real-time tasks over non real-time tasks.

5 Dr. M. Munlin Real-Time and Multimedia Systems 5 Features of Real-Time Kernels Most real-time systems do not provide the features found in a standard desktop system. Reasons include Real-time systems are typically single-purpose. Real-time systems often do not require interfacing with a user. Features found in a desktop PC require more substantial hardware that what is typically available in a real-time system.

6 Dr. M. Munlin Real-Time and Multimedia Systems 6 Implementing Real-Time Operating Systems In general, real-time operating systems must provide: (1) Preemptive, priority-based scheduling  Higher priority process can preempt.  Soft real-time (2) Preemptive kernels  Allow a process running in kernel to be preempted  Hard real-time  Insert preemption point in a long system call, context switch to the high priority process, interrupt and return to system call  Windows XP are non-preemptive kernel (3) Latency must be minimized

7 Dr. M. Munlin Real-Time and Multimedia Systems 7 Minimizing Latency Event latency is the amount of time from when an event occurs to when it is serviced.

8 Dr. M. Munlin Real-Time and Multimedia Systems 8 Interrupt Latency Interrupt latency is the period of time from when an interrupt arrives at the CPU to when it is serviced.

9 Dr. M. Munlin Real-Time and Multimedia Systems 9 Dispatch Latency Dispatch latency is the amount of time required for the scheduler to stop one process and start another.

10 Dr. M. Munlin Real-Time and Multimedia Systems 10 Real-Time CPU Scheduling Periodic processes require the CPU at specified intervals (periods) p is the duration of the period d is the deadline by when the process must be serviced t is the processing time

11 Dr. M. Munlin Real-Time and Multimedia Systems 11 Scheduling of tasks when P 2 has a higher priority than P 1

12 Dr. M. Munlin Real-Time and Multimedia Systems 12 Rate Monotonic Scheduling A priority is assigned based on the inverse of its period Shorter periods = higher priority; Longer periods = lower priority P 1 is assigned a higher priority than P 2.

13 Dr. M. Munlin Real-Time and Multimedia Systems 13 Missed Deadlines with Rate Monotonic Scheduling

14 Dr. M. Munlin Real-Time and Multimedia Systems 14 Earliest Deadline First (EDF) Scheduling Priorities are assigned according to deadlines: the earlier the deadline, the higher the priority; the later the deadline, the lower the priority.

15 Dr. M. Munlin Real-Time and Multimedia Systems 15 Proportional Share Scheduling T shares are allocated among all processes in the system. An application receives N shares where N < T. This ensures each application will receive N / T of the total processor time.

16 Dr. M. Munlin Real-Time and Multimedia Systems 16 VxWorks 5.0

17 Dr. M. Munlin Real-Time and Multimedia Systems 17 Wind Microkernel The Wind microkernel provides support for the following: (1) Processes and threads; (2) preemptive and non-preemptive round-robin scheduling; (3) manages interrupts (with bounded interrupt and dispatch latency times); (4) shared memory and message passing interprocess communication facilities.

18 Dr. M. Munlin Real-Time and Multimedia Systems 18 Multimedia Multimedia data includes - audio and video clips (i.e. MP3 and MPEG files) - live webcasts Multimedia data may be delivered to - desktop PC’s - handheld devices (PDAs, smart phones, etc.)

19 Dr. M. Munlin Real-Time and Multimedia Systems 19 Media Delivery Multimedia data is stored in the file system like othe ordinary data. However, multimedia data must be accessed with specific timing requirements. For example, video must be displayed at 24-30 frames per second. Multimedia video data must be delivered at a rate which guarantees 24-30 frames/second. Continuous-media data is data with specific rate requirements.

20 Dr. M. Munlin Real-Time and Multimedia Systems 20 Streaming Streaming is delivering a multimedia file from a server to a client - typically the deliver occurs over a network connection. There are two different types of streaming: 1. Progressive download - the client begins playback of the multimedia file as it is delivered. The file is ultimately stored on the client computer. 2. Real-time streaming - the multimedia file is delivered to - but not stored on - the client’s computer.

21 Dr. M. Munlin Real-Time and Multimedia Systems 21 Real-time Streaming There are two types of real-time streaming: (1) Live streaming - used to deliver a live event while it is occurring. (2) On-demand streaming - used to deliver media streams such as movies, archived lectures, etc. The events are not delivered in real-time.

22 Dr. M. Munlin Real-Time and Multimedia Systems 22 Multimedia Systems Characteristics Multimedia files can be quite large. Continuous media data may require very high data rates. Multimedia applications may be sensitive to timing delays during playback of the media.

23 Dr. M. Munlin Real-Time and Multimedia Systems 23 Compression Because of the size and rate requirements of multimedia systems, multimedia files are often compressed into a smaller form. MPEG Compression: (1) MPEG-1 - 352 X 240 @ 30 frames/second (2) MPEG-2 - Used for compressing DVD and high-definition television (HDTV) (3) MPEG-4 - Used to transmit audio, video, and graphics. Can be delivered over very slow connections (56 Kbps)

24 Dr. M. Munlin Real-Time and Multimedia Systems 24 Operating Systems Issues The operating system must guarantee the specific data rate and timing requirements of continuous media. Such requirements are known as Quality-of-Service (QoS) guarantees. Guaranteeing QoS has the following effects in a computer system: (1) CPU processing (2) Scheduling (3) File systems (4) Network protocols

25 Dr. M. Munlin Real-Time and Multimedia Systems 25 Quality-of-Service (QoS) There are three levels of QoS (1) Best-effort service - the system makes a best effort with no QoS guarantees. (2) Soft QoS - allows different traffic streams to be prioritized, however no QoS guarantees are made. (3) Hard QoS - the QoS rquirements are guaranteed.

26 Dr. M. Munlin Real-Time and Multimedia Systems 26 Parameters Defining QoS Throughput - the total amount of work completed during a specific time interval. Delay - the elapsed time from when a request is first submitted to when the desired result is produced. Jitter - the delays that occur during playback of a stream. Reliability - how errors are handled during transmission and processing of continuous media.

27 Dr. M. Munlin Real-Time and Multimedia Systems 27 Resources on a file server

28 Dr. M. Munlin Real-Time and Multimedia Systems 28 CPU Scheduling Multimedia systems require hard realtime scheduling to ensure critical tasks will be serviced within timing deadlines. Most hard realtime CPU scheduling algorithms assign realtime processes static priorities that do not change over time.

29 Dr. M. Munlin Real-Time and Multimedia Systems 29 Disk Scheduling Disk scheduling algorithms must be optimized to meet the timing deadlines and rate requirements of continuous media. Earliest-Deadline-First (EDF) Scheduling SCAN-EDF Scheduling The EDF scheduler uses a queue to order requests according to the time it must be completed (its deadline.) SCAN-EDF scheduling is similar to EDF except that requests with the same deadline are ordered according to a SCAN policy.

30 Dr. M. Munlin Real-Time and Multimedia Systems 30 Deadline and cylinder requests for SCAN-EDF scheduling

31 Dr. M. Munlin Real-Time and Multimedia Systems 31 Network Management Three general methods for delivering content from a server to a client across a network: (1) Unicasting - the server delivers the content to a single client. (2) Broadcasting - the server delivers the content to all clients, regardless whether they want the content or not. (3) Multicasting - the server delivers the content to a group of receivers who indicate they wish to receive the content.

32 Dr. M. Munlin Real-Time and Multimedia Systems 32 Standard HTTP Streaming Protocol Standard HTTP is stateless whereby the server does not maintain the status of its connection with the client.

33 Dr. M. Munlin Real-Time and Multimedia Systems 33 Real-time Streaming Protocol

34 Dr. M. Munlin Real-Time and Multimedia Systems 34 RTSP States SETUP - the server allocates resources for a client session. PLAY - the server delivers a stream to a client session. PAUSE - the server suspends delivery of a stream. TEARDOWN - the server breaks down the connection and releases the resources allocated for the session.

35 Dr. M. Munlin Real-Time and Multimedia Systems 35 Tiger video server Video on demand for a large number of users Quality of service Scalable and distributed Low cost hardware Fault tolerant Tiger Network Clients

36 Dr. M. Munlin Real-Time and Multimedia Systems 36 Tiger architecture Storage organization Striping Mirroring Distributed schedule Tolerate failure of any single computer or disk Network support Other functions pause, stop, start

37 Dr. M. Munlin Real-Time and Multimedia Systems 37 Tiger video file server hardware configuration n+10n+21n+32n+432n+1n Controller Cub 0Cub 1Cub 2Cub 3Cub n ATM switching network video distribution to clients Start/Stop requests from clients low-bandwidth network high-bandwidth Cubs and controllers are standard PCs Each movie is stored in 0.5 MB blocks (~7000) across all disks in the order of the disk numbers, wrapping around after n+1 blocks. Block i is mirrored in smaller blocks on disks i+1 to i+d where d is the decluster factor

38 Dr. M. Munlin Real-Time and Multimedia Systems 38 Tiger schedule block play time T block service time t slot 0 viewer 4 state viewer  client viewer state: slot 1 free slot 2 free slot 3 viewer 0 state slot 4 viewer 3 state slot 5 viewer 2 state slot 6 free slot 7 viewer 1 state 012 Network address of client FileID for current movie Number of next block Viewer's next play slot Viewer state: slot 0 viewer 4 state viewer  client viewer state: slot 1 free slot 2 free slot 3 viewer 0 state slot 4 viewer 3 state slot 5 viewer 2 state slot 6 free slot 7 viewer 1 state Cub algorithm: Read the next block into buffer storage at the Cub. Packetize the block and deliver it to the Cub’s ATM network controller with the address of the client computer. Update viewer state in the schedule to show the new next block and play sequence number and pass the updated slot to the next Cub. Clients buffer blocks and schedule their display on screen. Stream capacity of a disk = T/t (typically ~ 5) Stream capacity of a cub with n disks = n x T/t


Download ppt "Dr. M. Munlin Real-Time and Multimedia Systems 1 NETE0516 Operating Systems Instructor: ผ. ศ. ดร. หมัดอามีน หมัน หลิน Faculty of Information Science and."

Similar presentations


Ads by Google