
- •Introduction
- •Applications of Real-Time Systems
- •Voltage
- •Figure 7: Conversion of an Analog Signal to a 16 bit Binary Number
- •Figure 11: Schematic Representation of tmr
- •It is relatively simple to design a hardware equipment to be fault-tolerant. The following are two methods that are popularly used to achieve hardware fault-tolerance:
- •Software Fault-Tolerance Techniques
- •Types of Real-Time Tasks
- •Timing Constraints
- •Events in a Real-Time System
- •Figure 16: Delay Constraint Between Two Events el and e2
- •Examples of Different Types of Timing Constraints
- •Figure 19: Classification of Timing Constraints
- •Real-Time Task Scheduling
- •Figure 1: Relative and Absolute Deadlines of a Task
- •Figure 2: Precedence Relation Among Tasks
- •Types of Real-Time Tasks and Their Characteristics
- •Classification of Real-Time Task Scheduling Algorithms
- •Figure 5: An Example Schedule Table for a Cyclic Scheduler
- •Figure 6: Major and Minor Cycles in a Cyclic Scheduler
- •Comparison of Cyclic with Table-Driven Scheduling
- •Hybrid Schedulers
- •Event-driven Scheduling
- •Is edf Really a Dynamic Priority Scheduling Algorithm?
- •Implementation of edf
- •Figure 10: Priority Assignment to Tasks in rma
- •We now illustrate the applicability of the rma schodulability criteria through a few examples.
- •Deadline Monotonic Algorithm (dma)
- •Handling Aperiodic and Sporadic Tasks
- •Dealing With Task Jitter
- •W Good real-time task scheduling algorithms ensure fairness to real-time tasks while scheduling.
- •State whether the following assertions are True or False. Write one or two sentences to justify your choice in each case.
- •Figure 2: Unbounded Priority Inversion
- •Highest Locker Protocol(hlp)
- •Priority Ceiling Protocol (pcp)
- •Comparison of Resource Sharing Protocols
- •Handling Task Dependencies
- •Fault-Tolerant Scheduling of Tasks
- •Clocks in Distributed Real-Time Systems
- •Clock Synchronization
- •Figure 1: Centralized synchronization system
- •Cn Slave clocks
- •Commercial Real-Time Operating Systems
- •Time Services
- •Clock Interrupt Processing
- •Providing High Clock Resolution
- •Figure 2: Use of a Watchdog Tinier
- •Unix as a Real-Time Operating System
- •In Unix, dynamic priority computations cause I/o intensive tasks to migrate to higher and higher priority levels, whereas cpu-intensive tasks are made to seek lower priority levels.
- •Host-Target Approach
- •Preemption Point Approach
- •Self-Host Systems
- •Windows As a Real-Time Operating System
- •Figure 9: Task Priorities in Windows nt
- •Open Software
- •Genesis of posix
- •Overview of posix
- •Real-Time posix Standard
- •Rt Linux
- •7.8 Windows ce
- •Benchmarking Real-Time Systems
- •Figure 13: Task Switching Time Among Equal Priority Tasks
- •Real-Time Communication
- •Figure 2: a Bus Architecture
- •Figure 4: Logical Ring in a Token Bus
- •Soft Real-Time Communication in a lan
- •Figure 6: Priority Arbitration Example
- •Figure 8: Problem in Virtual Time Protocol
- •Figure 9: Structure of a Token in ieee 802.5
- •Figure 10: Frames in the Window-based Protocol
- •Performance Comparison
- •A Basic Service Model
- •Traffic Characterization
- •Figure 16: Constant Bit-Rato Traffic
- •Routing Algorithms
- •Resource Reservation
- •Resource Reservation Protocol (rsvp)
- •Traffic Shaping and Policing
- •Traffic Distortion
- •Traffic Scheduling Disciplines
- •Figure 20: Packet Service in Jittor-edd
- •Differentiated Services
- •Functional Elements of DiffServ Architecture
- •Real Time Databases
- •Isolation: Transactions are executed concurrently as long as they do not interfere in each other’s computations.
- •Real-Time Databases
- •Real-Time Database Application Design Issues
- •Temporal Consistency
- •Concurrency Control in Real-Time Databases
- •It can bo shown that pcp is doadlock froo and single blocking. Rocolloct that single blocking moans that once a transaction starts executing after being blocked, it may not block again.
- •Speculative Concurrency Control
- •Comparison of Concurrency Control Protocols
- •Commercial Real-Time Databases
- •Figure 16: Uniform Priority Assignment to Tasks of Example 15
- •Version 2 cse, iit Kharagpur
Clock Interrupt Processing
Each time a clock interrupt occurs, besides incrementing the software clock, the handler routine carries out the following activities:
Figure
1: Structure of a Timer Queue
Process timer events: Real-time operating systems maintain either per-process timer queues or a single system-wide timer queue. The structure of such a timer queue has been shown in Fig. 5.1. A timer queue contains all timers arranged in order of their expiration times. Each timer is associated with a handler routine. The handler routine is the function that needs to be invoked when the timer expires. At each clock interrupt, tho kornol chocks tho timor data structures in tho timor quouo to soo if any timor ovont has occurred. If it finds that a timer ovont has occurred, then it queues tho corresponding handler routine in tho ready quouo.
Update ready list: Since tho occurrence of tho last clock ovont, somo tasks might have arrived or become ready duo to tho fulfillment of certain conditions they wore waiting for. Recollect from a basic course on operating system that arriving tasks and tasks waiting for somo ovont (such as a page fetch or a semaphore ovont) are queued in a wait quouo. Tho tasks in tho wait quouo are chocked to soo if any task has become ready in tho moan while. Tho tasks which are found to have become ready, are queued in tho ready quouo. If a task having highor priority than tho currently running task is found to have become ready, then tho currently running task is preempted and tho scheduler is invoked.
Update execution budget: At each clock interrupt, tho scheduler decrements tho timo slice (budget) remaining for tho executing task. If tho remaining budget for tho task becomes zero and tho task is not yet complete, then tho task is preempted, and tho scheduler is invoked to select another task to run.
Providing High Clock Resolution
Wo had pointed out in Sec. 5.1 that there are two main difficulties in providing a high resolution timor. First, tho overhead associated with processing tho clock interrupt becomes excessive as tho timo service resolution gets finer. Secondly, tho jitter associated with tho timo lookup system call (clock-gettimeO) is often of tho order of several milliseconds. Therefore, it is not useful to provide a clock with a resolution any finer than this. However, somo real-time applications need to deal with timing constraints of tho order of a few nano seconds. For such applications, an important question is: Is it at all possible to support timo measurement with nano second resolution? A way to provide sufficiently fine clock resolution is by mapping a hardware clock into the address space of applications. An application can then read the hardware clock directly through a normal memory read operation without having to make a system call. For example, on a Pentium processor, a user thread can bo made to road tho Pentium timo stamp counter. This counter starts at 0 when tho system is powered on and increments after each hardware clock interrupt. At today’s processor speed, this moans that during every nanosecond interval, tho counter increments several times.
However, making tho hardware clock readable by an application significantly reduces tho portability of tho application. For example, when an application running on a Pentium processor is ported to a different processor, tho now processor may not have a high resolution counter, and certainly tho memory address map and resolution would differ.
Timers
Wo had pointed out that timor service is a vital service that is provided to applications by all real-time operating systems. Real-time operating systems normally support two main types of timers: periodic timers and aperiodic (or one shot) timers. We now discuss some basic concepts about these two types of timers.
Periodic Timers: Periodic timers are used mainly for sampling events at regular intervals or performing somo activities periodically. Once a periodic timor is sot, it expires periodically. This is implemented using tho timor quouo as follows. Each timo tho periodic timor expires, tho corresponding handler routine is invoked, and tho timor data structure is inserted back into tho timor quouo (soo Fig. 5.1). For example, a periodic timor may bo sot to 100 mSec and its handler sot to poll tho temperature sensor after every 100 mSec interval.
Aperiodic (or One Shot) Timers: Those timers are sot to expire only once. Watchdog timers are a popular example of one shot timers.
Watchdog timers are used extensively in real-time programs to detect if a task misses its deadline, and then to initiate exception handling procedures upon a deadline miss. An example use of a watchdog timor has boon
I
f(){
^
wd_start(ti,exception-handler); M start
v
wd_tickle(); end