Beruflich Dokumente
Kultur Dokumente
• What is real-time?
– “a real-time system is a system whose
correctness includes its response time as well
as its functional correctness”
– The system doesn't just run software to plough
through the process; it needs to do it in a timely
manner
Introduction
• So, real-time systems care about
timeliness, but just how timely isn't clear
until you add a modifier to "real-time"
– In other words, real-time is very much a gray region
– "Response to what?" To "events", which are either
external events, communicated to the system via its
input/output interfaces (which include things like
Ethernet as well as audio, keyboard, or mouse
input), or to timer-triggered events within the system
itself
Outline
• Basic definitions
• The challenges
• Can we use existing systems
• Proposed solutions
• Case studies of real-time oss.
Basic definitions
• A task is the basic unit of execution. Each task
has three important properties:
1. release time: the point in time from which the
task can be executed.
2. deadline: the point in time by which the task
must complete.
3. execution time: the time the task takes to
execute
0 1 2 3 4 5 6 7 8 9 10 11
Classification of task timing
constraints
• There are two types of timing constraints hard
and soft.
• Definitions:
• if missing a deadline is a fatal error or has
disastrous consequences it is considered hard
(missing an occasional deadline is not
acceptable)
• otherwise (if some percentage of missed
deadlines is acceptable) it is soft.
• Classic examples:
braking systems controller => hard
multimedia streaming => soft
Soft real time systems
• Contain only tasks with no hard timing
constraints.
• Also known as “best effort” systems
• Most modern operating systems can serve as
the base for a soft real time systems.
• Examples:
multimedia transmission and reception,
networking, telecom (cellular) networks,
web sites and services, computer games.
Soft real time systems
• Examples:
air traffic control , vehicle subsystems
control, medical systems
Hard real time systems
• The scheduler than does one of two
operations :
– The first would be the allowance of the
process, guaranteeing that the process will
be completed on time
– The second would be the rejection of the
process. This is known as resource
reservation. This type of guarantee requires
that the scheduler knows the exact length of
time each type of process the operating
system to perform
Hard real time systems
• Basic definitions
• The challenges
• Can we use existing systems
• Proposed solutions
• Case studies of real-time oss.
The main challenges
• Basic definitions
• The challenges
• Deficiencies in modern operating systems
• Proposed solutions
• Case studies of real-time oss.
Why most modern OSs are
unsuitable
• The basic guiding concept for most
operating systems and schedulers is to
strive for good average performance while
in real time systems meeting the
deadlines is far more important than
average performance.
• many modern operating features are
problematic in a hard real time setting.
Windows
• Basic definitions
• The challenges
• Deficiencies in modern operating systems
• Proposed solutions
• Case studies of real-time OSs.
Scheduling
• Scheduling algorithm properties:
• An algorithm is said to be optimal if for each
task set for which a feasible scheduling is
possible the algorithm will find one (assumes
tasks are independent).
• Schedulable utilization is the maximal
utilization of a task set such that a task load
under this utilization will be scheduled
successfully by the algorithm.
Priority driven algorithms
1 2 3 4
1 1 2 2
0 1 2 3 4 5 6 7 8 9 10
The problem with static priority
driven algorithms
• This simple example shows that a schedulable
set of tasks can’t be scheduled based on static
priorities
task1: period=deadline=4 execution time=2
task2: period=deadline=10 execution time=5
Task 1 must have higher priority
1 2 3
1 1
Task 2 must have higher priority
0 1 2 3 4 5 6 7 8 9 10
EDF algorithm
1 2 3 4
1 2 2
0 1 2 3 4 5 6 7 8 9 10
EDF properties
• The algorithm is optimal.
• The schedulable utilization of the
algorithm is 1 .
• Priorities must only be recalculated when
a new task arrives, as time advances
equally for all tasks.
• the algorithm behaves unpredictably at
overloads, and suffers more from
overloads than RM.
LST algorithm
• The slack time of a task is the amount of
time until the task must be scheduled or
miss it’s deadline.
• The least slack time algorithm is a priority
driven algorithm in which the tasks receive
priorities according the their slack times.
The shorter the slack time the higher the
priority.
• The LST algorithm is optimal
Priority inversion
• The priority inversion problem exists in the
preemptive model when tasks are dependant on
one another (share resources). it causes a high
priority task to wait for a low priority task to
conclude because it is holding a critical
resource.
• This problem can be at least partially solved by
priority inheritance, or the priority ceiling protocol
based on a similar concept.
Outline
• Basic definitions
• The challenges
• Deficiencies in modern operating systems
• Proposed solutions
• Case studies of real-time OSs
Case study
• VxWorks
VxWorks