Title: EE512 System Programming
1EE512 System Programming
Lecture 17 Real-Time and Multimedia Systems
Nov. 26, 2009 Prof. Kyu Ho Park http//core.kaist.
ac.kr
1
2Real-Time SystemsCh.19,Silverschatz
- System Characteristics
- Features of Real-Time Systems
- Implementing Real-Time Operating Systems
- Real-Time CPU Scheduling
- Multimedia SystemsCh.20, Silverschatz
- What is Multimedia
- Requirements of Multimedia Kernels
- CPU Scheduling
- Disk Scheduling
3Objectives
- To explain the timing requirements of real-time
systems - To distinguish between hard and soft real-time
systems - To discuss the defining characteristics of
real-time systems - To describe scheduling algorithms for hard
real-time systems
4Overview 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.
5Features 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. -
6Virtual Memory in Real-Time Systems
- Address translation may occur via
- (1) Real-addressing mode where programs generate
actual addresses. - (2) Relocation register mode.
- (3) Implementing full virtual memory.
7Address Translation
8Implementing Real-Time Operating Systems
- In general, real-time operating systems must
provide - (1) Preemptive, priority-based scheduling
- (2) Preemptive kernels
- (3) Latency must be minimized
9Minimizing Latency
- Event latency is the amount of time from when an
event occurs to when it is serviced.
10Interrupt Latency
- Interrupt latency is the period of time from when
an interrupt arrives at the CPU to when it is
serviced.
11Dispatch Latency
- Dispatch latency is the amount of time required
for the scheduler to stop one process and start
another.
12Real-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
13Scheduling of tasks
- Scheduling of tasks when P2 has a higher priority
than P1
14Rate Montonic Scheduling
- A priority is assigned based on the inverse of
its period - Shorter periods higher priority
- Longer periods lower priority
- P1 is assigned a higher priority than P2.
15Scheduling of tasks
- Missed Deadlines with Rate Monotonic Scheduling
16Earliest Deadline First Scheduling
- Priorities are assigned according to
deadlinesThe earlier the deadline, the higher
the priority - the later the deadline, the lower the priority.
17Delayed Locking TechniqueJPLeeKPARK,2008
P
NP
RT
P
preemptible section
OS Latency
NP
non-preemptible section (critical section)
urgent interrupt
RT
real-time process section
P
RT
NP
urgent interrupt
- Entering a critical section is allowed only if
the operation does not disturb the future
execution of the real-time application - OS Latency is significantly reduced at the
expense of delaying execution of NP section
18Locking Decision
(a) Locking is prohibited (delayed)
enter ith section
P
RT
NP
tlock,i gt tintr,j ?
Y
N
tintr,j
tlock,i
urgent timer interrupt
decision point
Locking is prohibited
Locking is allowed
(b) Locking is allowed
enter wait queue
P
NP
P
RT
tlock,i
tintr,j
- tintr,j time remaining until the next j-th
urgent interrupt - tlock,i time taken to execute an i-th
non-preemptible section (lock hold time)
decision point
urgent timer interrupt
19OS Latency
20Multimedia SystemsObjectives
- 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
21What is Multimedia?
- Multimedia data includes
- - audio and video clips (i.e. MP3 and MPEG
files) - - live webcasts
- Multimedia data may be delivered to- desktop
PCs - - handheld devices (PDAs, smart phones)
-
22Media Delivery
- Multimedia data is stored in the file system like
other 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.
23Streaming
- 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 clients
computer.
24Real-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.
25Multimedia 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.
26Compression
- 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 _at_ 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)
27Operating 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.