Sie sind auf Seite 1von 34

Real-Time System

Er. Yogesh Aryal


Lecturer, Pulchowk Campus

Syllabus
S.N. Unit

Hours

Introduction

Hard versus Soft real time systems

Reference model of real time systems

Approaches to real time scheduling

Clock driven scheduling

Priority driven scheduling of periodic tasks

Scheduling aperiodic and sporadic jobs in priority driven


systems

Resources and resource access control

Multiprocessor scheduling. Resource access control and


synchronization

10

Real time communication

References

Real-Time Systems, Jane W. S. Liu,


Pearson Education Asia, 2003

Evaluation:

Internal Marks:
Test=10
Attendance=5
Class activities/participation and Home
assignment:5

Activities

Class assignment
Home assignment
Presentations
Report writing

Introduction to Real-Time Systems

What is a Real-Time System?

Real-time systems have been defined as: "those


systems in which the correctness of the system
depends not only on the logical result of the
computation, but also on the time at which the
results are produced";

J. Stankovic, "Misconceptions About Real-Time


Computing," IEEE Computer, 21(10), October
1988.
6

Real-Time Characteristics

Real-time systems often are comprised of a


controlling system, controlled system and
environment.

Controlling system: acquires information about


environment using sensors and controls the
environment with actuators.
Timing constraints derived from physical impact of
controlling systems activities. Hard and soft
constraints.

Periodic Tasks: Time-driven recuring at regular


intervals.

Aperiodic: event-driven.
7

Typical Real-Time System


Controlled System

Controlling
System

sensor
sensor
sensor
sensor
actuator
actuator
actuator
actuator

Environment

Sample Applications

Agile Manufacturing

Traffic control system

Signal-Processing System
Signal-processing systems transform data from one
form to another.
Examples:
Digital filtering.
Video and voice compression/decompression.
Radar signal processing.

Response times range from a few milliseconds to a few


seconds.

10

Example: Radar System

11

Air Traffic Control

[Reddaway et al. WMPP05]


12

Internet/Multimedia Applications
Web farms hosting multiple web
domains

static
dynamic streaming
content content video/audio

Each web domain receives a certain


share of the overall resources (CPU,
network, file system)
Each web domain consists of an
application pool (static content, dynamic
content, streaming video/audio, etc.)

Server

Challenges
Sharing the resource among domains
(i.e. application pools) may be hard in
general purpose Operating Systems
Guarantee of a uniform, steady, jitterfree execution of time critical
multimedia applications while not
starving other applications
Support of multiprocessor server
systems

Domain 1

Domain 3

Domain 2

13

Other Real-Time
Applications
Real-time databases.
Transactions must complete by deadlines.
Main dilemma: Transaction scheduling algorithms and realtime scheduling algorithms often have conflicting goals.
Data may be subject to absolute and relative temporal
consistency requirements.
Overall goal: reliable responses
Multimedia.
Want to process audio and video frames at steady rates.
TV video rate is 30 frames/sec. HDTV is 60 frames/sec.
Telephone audio is 16 Kbits/sec. CD audio is 128 Kbits/sec.
Other requirements: Lip synchronization, low jitter, low
end-to-end response times (if interactive).
14

Example: Real-Time
Applications
Many real-time systems are control systems
Example 1: A simple one-sensor, oneactuator control system

15

Hierarchical Control Systems

16

Real-Time Command
and
Control
The controller
at the highest level of a control hierarchy is a

command and control system.


An Air Traffic Control (ATC) system is an excellent example.
Figure shows a possible architecture.
The ATC system monitors the aircraft in its coverage area
and the environment (e.g, weather condition) and
generates and presents the information needed by the
operators (i.e., the air traffic controllers).
Outputs from the ATC system include the assigned arrival
times to metering fixes for individual aircraft.
As stated earlier, these outputs are reference inputs to onboard flight management systems. Thus, the ATC system
indirectly controls the embedded components in low levels
of the control hierarchy.
In addition, the ATC system provides voice and telemetry
links to on-board avionics. Thus it supports the
communication among the operators at both levels (i.e., the
pilots and air traffic controllers).
17

18

Hard Real-Time Systems


A hard deadline must be met.
If any hard deadline is ever missed, then the
system is incorrect.
Requires a means for validating that deadlines
are met.
Hard real-time system: A real-time system in
which all deadlines are hard.
We consider hard and soft real-time systems in
this course.
Examples: Nuclear power plant control, flight
control.
19

Soft Real-Time Systems


A soft deadline may occasionally be
missed.
Question: How to define
occasionally?
Soft real-time system: A real-time
system in which some deadlines are
soft.
Examples: multimedia applications.
20

Job versus Task


Job: unit of work that is scheduled and
executed by the system
Computation of a FFT (Fast Fourier
Transform)
Transmission of a data packet
Task: a set of related jobs which jointly
provide some system function

21

Release Time and


Deadlines
Release time
the instant of time at which the job
becomes available for execution
Jobs have no release time if all the jobs
are released when the system begins
execution
Response time
The length of time from the release time
of the job to the instant when it completes
22

Release Time and


Deadlines (Cont.)
Relative deadline
The maximum allowable response time of a
job
Deadline or Absolute Deadline
The instant of time by which its execution is
required to be completed
Equal to the release time plus the relative
deadline
A job has no deadline if its deadline is at
infinity
23

Feasibility
Timing Constraints
A constraints imposed on the timing behavior of a
job
Specified in terms of
Release time
Relative deadline or absolute deadline
The set of rules that determines the order in which
tasks are executed is called a scheduling algorithm
A schedule is feasible if all tasks can be completed
according to the timing constraints
A set of tasks is schedulable if there exists at least
one algorithm that can produce a feasible schedule
24

Type of Tasks
A Periodic task is executed repeatedly at regular
time intervals, and each invocation is called a job or
instance.
Often time-driven
A Aperiodic task is executed to response to external
events, and to respond, it executes aperiodic jobs
whose release time are not know a priori
Often event-driven
Off-line guarantee of aperiodic tasks must make
proper assumptions on the environments; that is,
by assuming a maximum arrival rate for each
event (i.e., minimum inter arrival time)
Aperiodic tasks characterized by a minimum
inter arrival time are called sporadic tasks
25

Classification of
Scheduling Algorithm
Preemptive/Non-preemptive
Preemptive: the running tasks can be interrupted
to assign the processor to another task
Non-preemptive: A task, once started, is
executed until completion.
Static/Dynamic
Static: the scheduling decisions are based on
fixed parameters and assigned to tasks before
their activation
Dynamic: the scheduling decisions are based on
dynamic parameters that may change during
system evolution
26

Classification of
Scheduling Algorithm
(Cont.)
Off-line/On-line
Off-line: a scheduling algorithm is executed on
the entire task set before actual task
activation. The schedule may be stored in a
table and later executed by a dispatcher
On-line: scheduling decisions are taken at
runtime every time a new task enter the
system or when a running task terminates

27

Classification of
Scheduling Algorithm
(Cont.)
Optimal/Heuristic
Optimal: an algorithm is optimal if it minimizes
some given cost function defined over the task set.
If no cost function is given and only concern
feasibility, an algorithm is optimal if it may fail to
meet deadline only if no other algorithms can
meet it
Heuristic: an algorithm is heuristic if it tends toward
but does not guarantee to find the optimal schedule
Dynamic/Fixed
Fixed: in which the priority of each process is fixed
for any instantiation
Dynamic: in contrast from above
28

Metrics for Performance


Evaluation
Metrics for hard real-time system
Schedulability
Optimality, etc.
Metrics for soft real-time system
Miss ratio
Response time, etc.
Other metrics
Completion time
Jitter, etc.
Combination of metrics
29

Commonly Used
Approaches to Real-Time
Scheduling
Clock-Driven
Priority-Driven

30

Clock-Driven Approach
Also called time-driven
Because each scheduling decision is made at a
specific time, independent of events, such as job
releases or completions, in the system
Applicable only when the system is deterministic,
except for a few aperiodic jobs
The parameters of all periodic tasks are known a
priori
Therefore, the scheduler is often constructed by a
static schedule of the jobs off-line
Use a hardware timer to trigger the scheduling
decision
31

Priority-Driven Approach
Scheduling decisions are made when events,
such as release and completions of job occurs
Therefore, priority-driven algorithms are
event-driven
Many non-real-time scheduling algorithms are
priority-driven
FIFO (First-In-First-Out)
Assign priority according to the release time
SETF (Shortest-Execution-Time-First)
Assign priority on the basis of job execution
times
32

Priority-Driven Approach
(Cont.)
Priority-driven real-time scheduling
algorithms
Dynamic-priority
e.g. EDF (Earliest Deadline First)
Fixed-priority
e.g. RM (Rate Monotonic)

33

Questions
1)What is a real time system ? Explain its various components with
a suitable block diagram.
2)What is hard real time system? Explain with example.
3)What is soft real time systems? Explain with example.
4)Differentiate between hard real time systems and soft real time
systems.
5)Explain the RADAR signals processing with block diagram .
6)What is digital control? Explain with example.
7)Explain the real-time command and control system with suitable
example.

Das könnte Ihnen auch gefallen