Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
=
m
i
i
i
P
C
i
P
1
Rate Monotonic Scheduling (continued)
Then using these priorities in scheduler guarantees
the needed Quality of Service (QoS), provided that
) 1 2 (
1
1
s
=
m
m
i
i
i
m
P
C
Asymtotically approaches ln 2 as m
I.e., must maintain some slack in scheduling
Assumes fixed amount of processing per periodic
task
Not MPEG!
Processor Scheduling for Real-Time
Earliest Deadline First (EDF) Scheduling
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
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.
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%
However, it is usually a good idea to build
in some slack
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
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
Frame vs. Block organization
smaller
larger
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
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
Disk Scheduling (continued)
SCAN (Elevator) algorithm for each frame
interval
Sort by cylinder #
Complete in time for start of next frame interval
Variation SCANEDF:
Sort requests by deadline
Group similar deadlines together, apply SCAN to
group
Particularly useful for non-uniform block sizes and
frame intervals
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
Push vs. Pull server
Bandwidth Negotiation
Client (or application) provides feedback to
server to adjust bandwidth
E.g.,
Windows Media Player
RealPlayer
QuickTime
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
SOME USEFUL THEOREMS AND
TRANSFORMATION
Digression on Transforms
Fouriers theorem:
Every continuous periodic function can be
reduced to the sum of a series of sine waves
The Fourier transform is a representation of
that function in terms of the frequencies of
those sine waves
Original function can be recovered from its
Fourier transform
Fourier transforms occur frequently in
nature!
Nyquists Theorem (1924)
If a continuous function is sampled at a frequency
2f, then the function can be recovered from those
samples provided that its maximum Fourier
frequency is s f.
Discrete Cosine Transform
A form of the Fourier Transform
When applied to an 88 block of samples
(i.e. pixel values) yields an 88 block of
spatial frequencies
Original 88 block of samples can be
recovered from its DCT.
Assuming infinite arithmetic precision
More on Nyquist
If arithmetic precision is not infinite, we get
quantization error during sampling
Recovered signal has quantization noise
i.e., a lossy transform