Real Time Systems
Realtime system:
A real-time system is any information processing system which has to
respond to externally generated input stimuli within a finite and specified
period. It means that the system is subjected to real time i.e. response should
be guaranteed within a specified timing constraint or system should meet the
specified deadline.
Uses:
Flight control system.
Real time monitors.
Commands and Control systems.
Defence and space systems.
Networked multimedia systems.
Embedded automotive electronics.
Types of Real Time System:
Hard Real-Time System
Soft Real-Time System
Hard Real-Time System
A real time system is a data processing system. The time taken by the
system to respond to an input and provide the output or display the updated
information is known as the response time. So, in these systems, the
response time should be very minimum. The system should complete the
task within the deadline. In a real-time operating system, the correctness of
the system output depends on the logical result of computation as well as the
time it takes to produce the result.
Soft Real Time System
In a soft real time, system, the time requirement is not very crucial. The
system should perform the task or give the output within the deadline but
there can be a small tolerance occasionally. If the system, did not perform
the task within the deadline it is not considered as a failure as long as it
provides the required output. But performance is considered to be degraded.
Missing the deadline will not cause a catastrophic event like in a hard-real
time system.
Hard vs Soft Real Time System
A hard-real time system is a system in which a A soft real time system is a system in which one or
failure to meet even a single deadline may lead to more failures to meet the deadline is not considered
complete or catastrophic system failure. as complete system failure but that performance is
considered to be degraded.
Restrictive Nature
A Hard-real time system is very restrictive. A Soft real time system is not very restrictive.
Deadline
A Hard-real time system should not miss the A Soft real time system can miss the deadline
deadline. Missing the deadline cause complete or occasionally. Missing the deadline is not
catastrophic system failure. considered as a complete system failure but
degrades the performance.
Utility
A hard-real time system has more utility. A soft real time system has less utility.
Examples
Air traffic control systems, missile, and nuclear Multimedia streaming, advanced scientific projects,
reactor control systems are some examples of and virtual reality are some examples of soft real
hard real time systems. time systems.
Examples and applications
Real-time systems have of late, found applications in wide ranging areas.
Industrial Applications:
Chemical Plant Control
In an automated chemical plant, a real-time computer periodically monitors
plant conditions. The plant conditions are determined based on current
readings of pressure, temperature, and chemical concentration of the reaction
chamber. These parameters are sampled periodically. Based on the values
sampled at any time, the automation system decides on the corrective actions
necessary at that instant to maintain the chemical reaction at a certain rate.
Typically, the time bounds in such a chemical plant control application range
from a few micro seconds to several milliseconds.
Automated Car Assembly Plant
In an automated car assembly plant, the work product moves on a conveyor
belt. By the side of the conveyor belt, several workstations are placed. An
empty chassis is introduced near the first workstation on the conveyor belt.
As soon as the partially assembled product is sensed by sensor, the
workstation begins to perform its work on the product. The time constraint
imposed on the workstation computer is that the workstation must complete
its work before the work product moves away to the next workstation. The
time bounds involved here are typically of the order of a few hundreds of
milliseconds.
Medical
Robot Used in Recovery of Displaced Radioactive Material
Radioactive materials such as Cobalt and Radium are used for treatment of
cancer. At times during treatment, the radioactive Cobalt (or Radium) gets
dislocated and falls down. Since human beings can not come near a
radioactive material, a robot is used to restore the radioactive material to its
proper position. The robot has to sense its environment frequently and based
on this information, plan its path to pick and restore the material position.
The real-time constraint on the path planning task of the robot is that unless it
plans the path fast enough after an obstacle is detected, it may collide with it.
The time constraints involved here are of the order of a few milliseconds.
Aerospace
Computer On-board an Aircraft
In many modern aircrafts, the pilot can select an “auto pilot” option. As soon
as the pilot switches to the “auto pilot” mode, an on-board computer takes
over all controls of the aircraft including navigation, take-off, and landing of
the aircraft. In the “auto pilot” mode, the computer periodically samples
velocity and acceleration of the aircraft. From the sampled data, the on-board
computer computes X, Y, and Z co-ordinates of the current aircraft position
and compares them with the pre-specified track data. In this case, the
sampling of the various parameters, and their processing need to be
completed within a few micro seconds.
Real-Time CPU Scheduling ,
CPU scheduling for real-time operating systems involves special issues. As the
difference between soft and hard time real systems is given above. Soft real-
time systems provide no guarantee as to when a critical real-time process will
be scheduled. They guarantee only that the process will be given preference
over noncritical processes. Hard real-time systems have stricter requirements. A
task must be serviced by its deadline; service after the deadline has expired is
the same as no service at all.
Here are several issues related to process scheduling in both soft and hard real-
time operating systems.
Minimizing Latency:
Consider the event-driven nature of a real-time system. The system is
typically waiting for an event in real time to occur. Events may arise either
in software (as when a timer expires) or in hardware(as when a
remote)controlled vehicle detects that it is approaching an obstruction.
When an event occurs, the system must respond to and service it as quickly
as possible. Event latency as the amount of time that elapses from when an
event occurs to when it is serviced.
Usually, different events
have different latency requirements. For example, the latency requirement
for an antilock brake system might be 3 to 5 milliseconds. That is, from the
time a wheel first detects that it is sliding, the system controlling the
antilock brakes has 3 to 5 milliseconds to respond to and control Any
response that takes longer might result in the automobile’s veering out of
control. In contrast, an embedded system controlling radar in an airliner
might tolerate a latency period of several seconds. Two types of latencies
affect the performance of real-time systems:
Interrupt latency.
Dispatch latency.
Priority-Based Scheduling:
The most important feature of a real-time operating system is to respond
immediately to a real-time process as soon as that process requires the CPU.
286 Chapter 6 CPU Scheduling As a result, the scheduler for a real-time
operating system must support a priority-based algorithm with preemption.
More important tasks are assigned higher priorities than those deemed less
important. If the scheduler also supports preemption, a process currently
running on the CPU will be preempted if a higher-priority process becomes
available to run.
Providing a preemptive, priority-based scheduler only guarantees soft real-
time functionality. Hard real-time systems must further guarantee that real-
time tasks will be serviced in accord with their deadline requirements, and
making such guarantees requires additional scheduling features.
Certain characteristics of the process.
The processes are considered periodic
It has a fixed processing time t, a deadline d by which it must be serviced
by the CPU, and a period p.
What is unusual about this form of scheduling is that a process may have to
announce its deadline requirements to the scheduler. Then, using a technique
known as an admission-control algorithm, the scheduler does one of two
things. It either admits the process, guaranteeing that the process will
complete on time, or rejects the request as impossible if it cannot guarantee
that the task will be serviced by its deadline.
Periodic tasks
Rate-Monotonic Scheduling:
The rate-monotonic scheduling algorithm schedules periodic tasks using a
static priority policy with preemption. If a lower-priority process is running
Scheduling of tasks when P2 has a higher priority than P1.
and a higher-priority process becomes available to run, it will preempt the
lower-priority process. Upon entering the system, each periodic task is
assigned a priority inversely based on its period. The shorter the period, the
higher the priority; the longer the period, the lower the priority.
Furthermore, rate-monotonic scheduling assumes that the processing time of
a periodic process is the same for each CPU burst. That is, every time a
process acquires the CPU, the duration of its CPU burst is the same.
Earliest-Deadline-First Scheduling:
Earliest-deadline-first (EDF) scheduling dynamically assigns priorities
according to deadline. The earlier the deadline, the higher the priority; the
later the deadline, the lower the priority. Under the EDF policy, when a
process becomes runnable, it must announce its deadline requirements to the
system. Priorities may have to be adjusted to reflect the deadline of the newly
runnable process. Note how this differs from rate-monotonic scheduling,
where priorities are fixed.
Proportional Share Scheduling:
Proportional share schedulers operate by allocating T shares among all
applications. An application can receive N shares of time, thus ensuring that
the application will have N/T of the total processor time.
As an example, assume that a total of T = 100 shares is to be divided among
three processes, A, B, and C. Ais assigned 50 shares, B is assigned 15 shares,
and C is assigned 20 shares. This scheme ensures that A will have 50 percent
of total processor time, B will have 15 percent, and C will have 20 percent.