Professional Documents
Culture Documents
Upendra Babu
This session
Previous session
– What is Real Time systems
We shall discuss
– Basic Issues in real-time systems
– task classes
– Types of real Time systems
– How to measure the performance of an real time system
At the end of the class, you should be able to
– Understand the different issues of a real time system
– Understand and differentiate between types of real time systems
– Understand and differentiate between types of real time tasks
– Understand how to quantify the performance of a real time system
Upendra Babu
Issues
Upendra Babu
Issues in Real Time Systems
Issues in a Real time system can be categorized
into
–Expectancy
–Jobs
–Data
–environment
Upendra Babu
Expectancy
A Real time system is expected to be
Highly Reliable
Capable of working in harsh environment
Fault tolerant
Also
Maintain fairness by sharing resources equally
among all users
While
Must meet real time constraint
Upendra Babu
Jobs
In A typical Real time system
Jobs can be
–Scheduled to run at specific time intervals
–initiated from control level
–Triggered by actuators like sensors
Upendra Babu
Data
Real time system has to use data from
environment (actuators, sensors), past history
(database)
•Data from actuators can be erroneous
•Noisy environment
•Slow data rate from mechanical sensors
Upendra Babu
Environment
• Real time systems are expected to work in
extremely harsh environments
–High EMP’s
–High Static energy
• Still the system is expected to compute at very
high speeds (50 million instructions /sec)
Upendra Babu
Architecture Issues
• Process Arch :
• RTS needs estimate of execution time for the given
stretch of code.
• The analysis should be done to know how long an
arch will take to execute a given code block.
• Network Arch :
• Deciding topology if network, n/w access functions
to special purpose n/w interface design, fault
tolerance design, Magnitude predictability and
controllability of network delays.
• Arch For Clock Synchronization :
• In RTS all clocks in various units must be
synchronized and fault tolerant.
• Fault Tolerance & Reliability Evaluation Upendra Babu
Operating System Issues
• Task Assignment & Scheduling :
• Scheduling of tasks to ensure that real time
deadlines are met.
• Communication Protocols :
• The inter process communication should have
predictable delays and should be controllable.
• Failure Mgmt And Recovery :
• When a processor or s/w module fails the system
must limit such failure and recover from it.
• Clock Synchronization Algorithms :
• fault tolerant.
Upendra Babu
Other Issues
• Programming Languages :
• The language should have greater control
over timing and need to interface with special
purpose devices
• Databases :
• Need of database to support hard RTS.
• Performance Measures :
• Measures are required that accurately convey
the needs of the application and accurately
characterize the computer’s ability to meet
such needs.
Upendra Babu
Decomposition
Upendra Babu
Decomposition
To facilitate smooth functioning of a real-time system the
system is logically de composed to 3 layers
• Layer 1 sensor and actuator layer
– Manages the slow data rates between sensors and
actuators
• Layer 2 peripheral layer
– Formats data from sensors to system specifications
– Formats data from system to formats required by different
actuators
• Layer 3 core layer
– Cluster of processors that execute control algorithms
Upendra Babu
Task Classes
Tasks can be classified based on
– Type of tasks
• Static
• dynamic
– Predictability of their arrival
• Periodic
• Aperiodic
• sporadic
– Consequences of non time compliance
• Critical
• Non critical
Upendra Babu
Static
• Task arrival times can be predicted
• Static (compile-time) analysis possible
• Allows good resource usage (low idle time for
processors).
Upendra Babu
Dynamic
• Arrival times unpredictable
• Static (compile-time) analysis possible only for
simple cases.
• Processor utilization decreases dramatically.
• In many real systems, this is very difficult to
handle.
• Must avoid over-simplifying assumptions
– e.g., assuming that all tasks are independent,
when this is unlikely.
Upendra Babu
Periodic
• Each task (or group of tasks) executes
repeatedly with a particular period.
• Allows some static analysis techniques to be
used.
• Matches characteristics of many real problems
• It is possible to have tasks with deadlines
smaller, equal to, or greater than their period.
– The later are difficult to handle (i.e., multiple
concurrent task instances occur).
Upendra Babu
Periodic
• Single rate:
– One period in the system
– Simple but inflexible
– Used in implementing a lot of wireless sensor
networks.
• Multi rate:
– Multiple periods
– Should be harmonics to simplify system design
Upendra Babu
Aperiodic
• Are also called sporadic, asynchronous, or
reactive.
• Creates a dynamic situation
• Bounded arrival time interval are easier to
handle
• Unbounded arrival time intervals are
impossible to handle with resource-
constrained systems.
Upendra Babu
Sporadic
• Sporadic Tasks
– Aperiodic tasks with known minimum inter-arrival
time.
Upendra Babu
Types Of Real Time Systems
A deadline is a given time after a triggering event,
by which a response has to be completed.
Based on the cost/loss the real-time systems can be
classified as
• Hard real-time systems
• Soft real-time systems
• Firm real-time systems
• Weakly hard real-time
• Nearly real time
Upendra Babu
Hard Real-Time Systems
Any overrun in response time leads to potential
loss of life and/or big financial damage
• Many of these systems are considered to be
safety critical.
• Sometimes they are “only” mission critical,
with the mission being very expensive.
• In general there is a cost function associated
with the system.
Upendra Babu
Hard Real-Time Systems
Upendra Babu
Soft Real-Time Systems
• Deadline overruns are tolerable, but not
desired.
• There are no catastrophic consequences of
missing one or more deadlines.
• There is a cost associated to overrunning, but
this cost may be abstract.
• Often connected to Quality-of-Service (QoS)
Upendra Babu
Soft Real-Time Systems
Upendra Babu
Firm Real-Time Systems
• The computation is obsolete if the job is not
finished on time.
• Cost may be interpreted as loss of revenue.
• Typical example are forecast systems.
Upendra Babu
Firm Real-Time Systems
Upendra Babu
Weakly Hard Real-Time Systems
• Systems where m out of k deadlines have to be
met.
• In most cases feedback control systems, in
which the control becomes unstable with too
many missed control cycles.
• Best suited if system has to deal with other
failures as well (e.g. Electro Magnetic
Interference EMI).
• Likely probabilistic guarantees sufficient.
Upendra Babu
Nearly Real-Time Systems
• However, in most cases the (soft) real-time
aspect may be constructed (e.g. acceptable
response time to user input).
• Computer system is backed up by hardware
(e.g. end position switches)
• Quite often simply oversized computers.
Upendra Babu
Task constraints
• Deadline constraint
• Resource constraints
– Shared access (read-read)
– Exclusive access (write-x)
• Precedence constraints
– T1 T2: Task T2 can start executing only after T1 finishes its
execution
• Fault-tolerant Requirements
– To achieve higher reliability for task execution
– Redundancy in execution
Upendra Babu
Predictability
• Predictability
• The most common denominator that is expected from a real-time system is
predictability.
• In dynamic systems, predictability means that once a task is admitted into the
system, its guarantee should never be violated as long as the assumptions
under which the task was admitted hold.
Upendra Babu
Real-Time Operating Systems (RTOSs)
• RTOS: specialized operating system for RTS
• Main responsibilities:
– Process management
– Resource allocation (processor, memory, network)
• They may not include regular OS facilities such as file
management, virtual memory, user/kernel level separation,
etc.
• Manage at least two priority levels:
– Interrupt level, for processes that need fast response
– Clock level, for periodic processes
• Typical components: real-time clock, interrupt handler,
scheduler, resource manager, dispatcher
Upendra Babu
Performance Measures
Upendra Babu
Real Time Systems
• Real Time Systems
• Used in critical applications
• System characterization should reflect
• Design correctness
• Performance
• Reliability
Upendra Babu
Performance Measures
What are performance measures
– collecting, analyzing and reporting information
regarding the performance
Upendra Babu
Properties of performance Measures
Efficient coding of relevant information
•Record all information
•Highlight relevant information
•Application oriented
Objective basis for comparing and ranking
•Quantify the goodness of a computer
Objective optimization criteria for design
•Difficult to compare systems with different complexities
•Application sensitive optimization criteria
Represent verifiable facts
•allow validation to the required level of accuracy
Upendra Babu
Traditional Performance Measures
• Traditional Performance Measures
• Reliability
• Availability
• Throughput
Reliability
– Probability that system will not fail over a prescribed time
Availability
– The ratio of the total time the system is capable of being used during
to the length of the interval.
Throughput
– Average number of instructions processed per unit time
Upendra Babu
Performance Measures for RTOS
Traditional Measures for RTOS
Upendra Babu
Performance Measures for RTOS
A process controlled by a real time system has
several defined levels of levels of performance
Accomplishing a level ⇒
executing the sets of algorithms of all the tasks in the level
Upendra Babu
Performability as a Measure
Performability
⇒ Probability that a system will accomplish
each level.
If a process has n levels of accomplishments
A1, A2, A3,……, An.
Performability of the system is described as a vector
(P(A1), P(A2), P(A3),…….., P(An))
Upendra Babu
Hierarchical levels of views
Upendra Babu
Compliance with Properties
Efficient coding
•Information from all the levels is recorded
•Information hiding level based views
Objective basis for comparing and ranking
•User application oriented
•Provides objective for comparison between systems
Objective optimization criteria for design
•Provides objective statistics for enhancing design
Represent verifiable facts
•Provides verifiable facts depending on the mod used
Upendra Babu