RTS Notes
RTS Notes
UNIT 1:
1. Introduction to Real-Time Systems
A Real-Time System (RTS) is a system that must respond to inputs or events within a speci ed
deadline. The correctness of such systems depends not only on the logical results of computations
but also on the time at which the results are produced.
Examples:
• Soft Real-Time Systems: Missing a deadline is undesirable but not fatal (e.g., video
streaming).
• Firm Real-Time Systems: Occasional deadline misses are tolerable, but the results are
discarded if late.
• Real-Time Operating System (RTOS): Manages hardware resources and task scheduling.
c. Based on Control:
d. Based on Application:
4. Embedded Systems
An Embedded System is a computer system designed for dedicated functions within a larger
system, often with real-time computing constraints.
Features:
fi
fi
• Speci c functionality
• Real-time operation
• Resource-constrained
Examples:
• Washing machines
• Microwave ovens
• Smartwatches
• Industrial robots
b. Timing Constraints:
c. Resource Management:
d. Synchronization:
e. Interrupt Handling:
f. Fault Tolerance:
g. Power Constraints:
UNIT 2:
1. Task Assignment & Scheduling
Overview
• Goal: Assign tasks to processors and schedule them to meet deadlines and optimize
performance.
• Tasks may have constraints such as periodicity, deadlines, execution time, and priority.
• Assumption: Tasks are periodic, with xed execution time and deadlines equal to their
periods.
• Schedulability Test:
• ∑i=1nCiTi≤n(21/n−1)
i=1∑n Ti Ci ≤n(21/n−1)where C
iCi = execution time, T
Ti = period.
• Priority Rule: Task with the earliest deadline has the highest priority.
• Schedulability Test:
•
∑i=1nCiTi≤1i=1∑n Ti Ci ≤1
• Scheduling involves selecting which tasks to run to maximize rewards and meet deadlines.
• Depends on:
4. Reward Functions
4.1 Identical vs Non-identical Processors
• Utilization
• Ui=∑CiTiUi =∑Ti Ci
• Procedure:
2. If the processor cannot schedule it under RM, try the next one.
3. Repeat until the task is placed or fail if no processor can schedule it.
UNIT 3:
Features:
Advantages:
Disadvantages:
Solutions:
• Deadline-aware Scheduling
Tasks:
5. Kernel in RTOS
Functions:
• Task scheduling
• Interrupt handling
• Time management
Characteristics:
• Deterministic behavior
• Minimal jitter
• Small footprint
6. Case Studies
a. QNX
• Features:
◦ POSIX-compliant
• Features:
◦ Small footprint
◦ Deterministic response
c. VxWorks
• Features:
◦ Preemptive multitasking
UNIT 4:
Fault Tolerance Techniques
1. Introduction
Fault tolerance is the ability of a system to continue functioning correctly even in the presence of
faults. It aims to ensure system reliability, availability, and dependability despite errors.
Types of Faults:
• Watchdog timers
• Heartbeat signals
• Exception monitoring
Error Containment:
• Prevents the propagation of errors using:
◦ Memory protection
◦ Process isolation
3. Redundancy
Redundancy is a key strategy for fault tolerance, involving extra components or information.
Types of Redundancy:
4. Data Diversity
• Multiple versions of the same data are used to check for discrepancies.
5. Reversal Checks
Clock Synchronization
1. Introduction
In distributed systems, each machine has its own clock, which may drift from others due to
hardware imperfections. Synchronization ensures coherent timestamps, essential for ordering
events and coordination.
2. Clocks
Cristian’s Algorithm:
Limitations:
• Not fault-tolerant.
4. Impact of Fault
Hardware-based Synchronization
• Uses Pulse Per Second (PPS) signals (e.g., from GPS).
Software-based Synchronization
• Fault-Tolerant Protocols:
UNIT 5:
Real-time communication refers to the exchange of information with minimal delay, enabling
instant or live interaction between two or more parties. It is essential in applications like video
conferencing, VoIP, online gaming, and industrial control systems.
Best choice for real-time: Star or Mesh topologies, especially with switches or routers supporting
QoS (Quality of Service).
• RTP (Real-Time Protocol): Used for delivering audio and video over IP networks.
• RTCP (RTP Control Protocol): Monitors RTP transmission statistics and QoS.
• VoIP Protocols: SIP (Session Initiation Protocol), H.323 – initiate and control
communication sessions.
• RSVP is used to reserve resources (bandwidth, buffer space) in routers for a real-time
data ow.
c. Time Protocols
• NTP (Network Time Protocol): Synchronizes clocks across systems to ensure time
consistency.
• PTP (Precision Time Protocol): More accurate than NTP; used in nancial, industrial, and
telecom systems.
d. Contention-Based Protocols
Used in shared medium networks where multiple devices compete to send data.
Note: Contention-based protocols can introduce unpredictable delays, making them less suitable
for strict real-time systems, unless used with traf c prioritization.
fi