CS 771/871 Operating Systems
[ Home | Class
Roster | Syllabus | Status | Glossary | Search
| Course Notes]
Real Time Distributed Systems
- Distinguishing Characteristic:
- Processing must be done by
some (external) deadline.
Real time systems interact with the
external environment in timely fashion.
- OUTPUT: Presenting continuous
synchronized data streams (e.g. video/audio)
- INPUT: Recording external
events (scientific experiment)
- BOTH: Controlling external
devices (airplane airelons, car fuel injection, ATC)
Penalties for missed dealines:
- Soft real-time: system
performs at degraded but acceptable level
- Hard real-time: Mission
critical, missed deadline could lead to failure to
accomplish mission.
External Stimulii
Real-time systems respond to an
external stimulus (possible a clock)
Reaction to stimulus must occur by deadline.
Stimulii can be:
- Periodic: occur on regular
basis every DELTA T units of time
- Aperiodic: recur at an
irregular rate (arrival of customers)
- Sporadic: unusual event
Trend to dedicate processing power
to individual sensors and actuators:
Creates a distributed real time system.
Myths of Real Time Systems
Rather need sufficient
capacity for peak loads.
Need fault tolerance
System should be FAIL-SAFE.
Event vs Time Triggered Systems
Event Triggered:
- Sensor interrupts
- Event Shower can occur under
heavy loads causing overloads
- Can gives fast response to
aperiodic or sporadic event
- Responses in correct event
order.
Time Triggered:
- Periodic clock interrupts,
then poll system for events.
- Can prioritize polls (deal
with crisis first)
- What about events shorter than
clock rate
- Granularity of interrupts an
issue
Language Support
Language should help manage
real-time aspects (Hal/S and Ada have some support)
Predictability leads to:
- for
loops instead of while
loops
- Specification of delays (who
guarantees?) Compiler can count instructions but must
negotiate with scheduling)
- Control of memory allocation
algorithms
- Non-blocking systems calls (or
time-outs specified).
- Infinite periodic processing
loops (to calculate required processing load for
periodic tasks, assign tasks to machines and
negotiate schedule).
NOTE: most of these require OS
concessions.
Real Time Communications: Ethernet
Ethernet is out: too Stochastic, if
"p" is probability of sending message, then
probability that a processor sends its message successfully
is . This approaches 0 as p approaches 1.
Real Time Communications: Token Ring
Time Division Multiplexing
Reserve capacity in a slotted TDMA
frame: suitable for WANs
Connection oriented transmission with reserved buffers in
switches (compatible with ATM).
Could reserve several
slots to increase bandwidth
Reliability in TDMA
Most protocols use time-out or CRC
to detect problems and retransmit
not suitable for real-time.
Solution: use multiple independent
paths
If probability of loss is P, then
probability of lossing all "n" channels is P**n.
Time Triggered Protocols (TTP)
Used in the MARS real time system.
- Nodes (1 or more) if more,
processors working together to build fault tolerant,
fail-silent node
- All nodes connected by two
reliable and independent TDMA broadcast nets
(probability of lost packet 1 every 30 million
years).
- time triggered
- clocks synchronized to within
10s of microseconds by TTP
- Global state: everybody knows
everybody else and when they should communicate.
Quick determination of crashed node.
- Current mode (what
processes active, what slots in TDMA)
- global time
- current system
membership
- Single layer:
- data transport
- clock synchronization
- membership management
TTP Packet Format
- ACK for previous node's
message, if missing all nodes (including node being
NAKed, mark node as missing)
- CRC is checksum for data and
global state. If global state wrong, detected by CRC
and message not ACKed
QUESTION: what is receiver's state is bad? Whom do
you trust?
- When initialize is set,
broadcast global state.
Non-members can now join, if their packet is ACKed
- Since synchonous protocol, can
use start of frame as a clocking signal.
Real Time Scheduling
Design Issues:
- hard of soft real time
- preemptive or not
- static or dynamic
- centralized or not
Feasibility of Schedule
Is a set of tasks schedulable?
If utilization is greater than the
number of processors, then not feasible to schedule.
NOTE: does not consider any
overhead (OS or network)
no dependencies between tasks
requires optimal scheduler algorithm
Dynamic Scheduling: Rate Monotonic Algorithm
- Preemptive (implies no mutual
exclusion constraints)
- No ordering dependencies
- Single Processor
Priority = periodicity, schedule
highest priority first,
provably optimal
If
then schedulable.
Other Dynamic Scheduling
- Earliest Deadline First:
optimal even with utlization = 1
- Least Laxity: Least amount of
slack time first.
None are optimal in a distributed
system.
Does not consider dependencies or
mutual exclusion contraints.
Static Scheduling
Schedule built off-line
Can handle dependencies
- Assign tasks to processors
- Schedule tasks on each
processor subject to communication between
processors.
Problem 25
Given the task dependency graph:
Schedule with TDMA Communications
Question: Is this
optimal?
Copyright chris wild 1996.
For problems or questions regarding this web contact [Dr. Wild].
Last updated: October 08, 1996.