Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)1 Multimedia Topics (continued) CS-3013 & CS-502 Operating Systems.

Similar presentations


Presentation on theme: "CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)1 Multimedia Topics (continued) CS-3013 & CS-502 Operating Systems."— Presentation transcript:

1 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)1 Multimedia Topics (continued) CS-3013 & CS-502 Operating Systems

2 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)2 Review CD-ROM & DVD devices Reading assignment about CD-R and DVD General requirements for multimedia in a computer Jitter-free Guaranteed scheduling Multiple interleaved streams Wide variety of bandwidths

3 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)3 Review (continued) Compression MP-3 – 10:1 JPEG – 20:1 MPEG-2 – 50:1- 80:1 Asymmetric compression Longer to compress than to decompress Take advantage of temporal locality

4 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)4 Outline Processor scheduling File, disk, and network management for multimedia in computers

5 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)5 Operating System Challenge How to get the contents of a movie file from disk or DVD drive to video screen and speakers. –Fixed frame rate (24, 25 or 30 fps) –Steady audio rate –Bounded jitter Classical problem in real-time scheduling –Obscure niche becomes mainstream! –See Silbershatz, Chapter 19

6 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)6 Two common methods Rate Monotonic Scheduling Earliest Deadline First Many variations Many analytic methods for proving QoS (Quality of Service)

7 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)7 Processor Scheduling for Real-Time Rate Monotonic Scheduling (RMS) Assume m periodic processes –Process i requires t i msec of processing time every p i msec. –Equal processing every interval — like clockwork!

8 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)8 Example Periodic process i requires the CPU at specified intervals (periods) p i is the duration of the period t i is the processing time d i is the deadline by when the process must be serviced –Often same as end of period

9 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)9 Processor Scheduling for Real-Time Rate Monotonic Scheduling (RMS) Assume m periodic processes –Process i requires t i msec of processing time every p i msec. –Equal processing every interval — like clockwork! Assume Assign priority of process i to be –Statically assigned Let priority of non-real-time processes be 0

10 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)10 Rate Monotonic Scheduling (continued) Scheduler simply runs highest priority process that is ready –May pre-empt other real-time processes –Real-time processes become ready in time for each frame or sound interval –Non-real-time processes run only when no real-time process needs CPU

11 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)11 Example p 1 = 50 msec; t 1 = 20 msec p 2 = 100 msec; t 2 = 35 msec Priority(p 1 ) > Priority(p 2 ) Total compute load is 75 msec per every 100 msec. Both tasks complete within every period 25 msec per 100 msec to spare

12 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)12 Example 2 p 1 = 50 msec; t 1 = 25 msec p 2 = 80 msec; t 2 = 35 msec Priority(p 1 ) > Priority(p 2 ) Total compute load is ~ 94% of CPU. Cannot complete both tasks within some periods Even though there is still CPU capacity to spare!

13 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)13 Rate Monotonic Theorems (without proof) Theorem 1: using these priorities, scheduler can guarantee the needed Quality of Service (QoS), provided that –Asymtotically approaches ln 2 as m   ln 2 = 0.6931… Theorem 2: If a set of processes can be scheduled by any method of static priorities, then it can be scheduled by Rate Monotonic method.

14 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)14 Example 2 again Note that p 1 pre-empts p 2 in second interval, even though p 2 has the earlier deadline!

15 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)15 More on Rate Monotonic Scheduling Rate Monotonic assumes periodic processes MPEG-2 playback is not a periodic process!

16 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)16 Processor Scheduling for Real-Time Earliest Deadline First (EDF) When each process i become ready, it announces deadline D i for its next task. Scheduler always assigns processor to process with earliest deadline. May pre-empt other real-time processes

17 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)17 Earliest Deadline First Scheduling (continued) No assumption of periodicity No assumption of uniform processing times Theorem: If any scheduling policy can satisfy QoS requirement for a sequence of real time tasks, then EDF can also satisfy it. –Proof: If i scheduled before i+1, but D i+1 < D i, then i and i+1 can be interchanged without affecting QoS guarantee to either one.

18 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)18 Earliest Deadline First Scheduling (continued) EDF is more complex scheduling algorithm Priorities are dynamically calculated Processes must know deadlines for tasks EDF can make higher use of processor than RMS Up to 100% There is a large body of knowledge and theorems about EDF analysis

19 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)19 Example 2 (again) Priorities are assigned according to deadlines: –the earlier the deadline, the higher the priority; –the later the deadline, the lower the priority.

20 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)20 Questions?

21 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)21 Multimedia File & Disk Management Single movie or multimedia file on PC disk –Interleave audio, video, etc. So temporally equivalent blocks are near each other –Attempt contiguous allocation Avoid seeks within a frame Text Frame Audio Frame

22 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)22 File organization – Frame vs. Block Frame organization Small disk blocks (4-16 Kbytes) Frame index entries point to starting block for each frame Frames vary in size (MPEG) Advantage: very little storage fragmentation Disadvantage: large frame table in RAM Block organization Large disk block (256 Kbytes) Block index entries point to first I-frame of a sequence Multiple frames per block Advantage: much smaller block table in RAM Disadvantage: large storage fragmentation on disk

23 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)23 Frame vs. Block organization smaller larger

24 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)24 File Placement on Server Random Striped “Organ pipe” allocation –Most popular video in center of disk –Next most popular on either side of it –Etc. –Least popular at edges of disk –Minimizes seek distance

25 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)25 Placing Multiple files on Single Disk Zipf’s Law Rank items by “popularity” Zif’s Law says: Probability that next customer will choose item k is approximately C/k –Where C is a normalization constant such that N = 10  C = 0.341 N = 100  C = 0.193 N = 1000  C = 0.134 N = 10000  C = 0.102

26 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)26 Zipf’s Law applied to US cities Points represent populations 20 largest cities – sorted on rank order

27 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)27 Application of Zipf’s Law to movie file placement Organ-pipe distribution of files on server –most popular movie in middle of disk –next most popular either on either side, etc.

28 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)28 Calculate … Probability that next movie is in the middle five cylinders

29 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)29 Questions?

30 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)30 Disk Scheduling (server) Scheduling disk activity is just as important as scheduling processor activity Advantage:– Predictability Unlike disk activity of ordinary computing In server, there will be multiple disk requests in each frame interval One request per frame for each concurrent video stream

31 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)31 Disk Scheduling (continued) SCAN (Elevator) algorithm for each frame interval Sort by cylinder # Complete in time for start of next frame interval Variation – SCAN–EDF: Sort requests by deadline Group similar deadlines together, apply SCAN to group Particularly useful for non-uniform block sizes and frame intervals

32 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)32 Network Streaming Traditional HTTP Stateless Server responds to each request independently Real-Time Streaming Protocol (RTSP) Client initiates a “push” request for stream Server provides media stream at frame rate

33 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)33 Push vs. Pull server

34 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)34 Bandwidth Negotiation Client (or application) provides feedback to server to adjust bandwidth E.g., –Windows Media Player –RealPlayer –Quicktime

35 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)35 Conclusion Multimedia computing is challenging Possible with modern computers Compression is essential, especially for video Real-time computing techniques move into mainstream Processor and disk scheduling There is much more to this subject than fits into one class

36 CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)36 Break


Download ppt "CS-3013 & CS-502, Summer 2006 Multimedia topics (continued)1 Multimedia Topics (continued) CS-3013 & CS-502 Operating Systems."

Similar presentations


Ads by Google