# What are Real Time Systems?

In this post, we will discuss and try to understand what real-time systems are.

The term “real time” is used widely in many contexts, both technical and conventional. Most people would probably understand “in real time” to mean “at once” or “instantaneously.”

Consider a computer system in which data need to be processed at a regular rate. For example, an aircraft uses a sequence of accelerometer pulses to determine its position. Systems other than avionic ones may also require a rapid response to events that occur at nonregular rates, such as handling an overtemperature failure in a nuclear power plant. Even without defining the term “real-time,” it is clear that those events demand timely or “real-time” processing.

Now consider a situation in which a passenger approaches an airline check-in counter to pick up his boarding pass for a certain flight from New Delhi to Mumbai, which is leaving in five minutes. The reservation clerk enters appropriate information into the computer, and a few seconds later a boarding pass is printed. Is this a real-time system?

Indeed, all three systems—aircraft, nuclear power plant, and airline reservations—are real-time, because they must process information within a specified interval or risk system failure. Although these examples may provide an intuitive definition of a real-time system, it is necessary to clearly comprehend when a system is real-time and when it is not.

To properly understand a Real-Time System, we need to clarify a few things first:

## Definition: System

A system is a mapping of a set of inputs into a set of outputs. When the internal details of the system are not of particular interest, the mapping function between input and output spaces can be considered as a black box with one or more inputs entering and one or more outputs exiting the system (see Fig. 1.1). Moreover, Vernon lists five general properties that belong to any “system” (Vernon, 1989):

1. A system is an assembly of components connected together in an organized way.
2. A system is fundamentally altered if a component joins or leaves it.
3. It has a purpose.
4. It has a degree of permanence.
5. It has been defined as being of particular interest.

Shown below is an example:

Every real-world entity, whether organic or synthetic, can be modeled as a system. In computing systems, the inputs represent digital/analog data from hardware devices or other software systems. The inputs are often associated with sensors, cameras, and other devices that provide analog inputs, which are converted to digital data, or provide direct digital inputs. The digital outputs of computer systems, on the other hand, can be converted to analog outputs to control external hardware devices, such as actuators and displays, or used directly without any conversion.

## Definition: Response Time

The time between the presentation of a set of inputs to a system and the realization of the required behavior, including the availability of all associated outputs, is called the response time of the system.

How fast and punctual the response time needs to be depends on the characteristics and purpose of the specific system.

With these two definitions clear, let us now see Real-Time Systems.

## Definition: Real-Time Systems

One definition of Real-Time Systems is:

A real-time system is a computer system that must satisfy bounded response time constraint or risk severe consequences, including failure.

Real-Time System can also be defined as:

A real-time system is one whose logical correctness is based on both the correctness of the outputs and their timeliness.

To simplify the above two definitions, a real-time system is an embedded system that generates correct output within a given timeline. It does not necessarily mean fast.

Say, for example, a system has the following features:

1. A button for user interface
2. User can press the button
3. Five seconds after the user releases the button, a buzzer is sounded.

The correct output for this system is the sounding of buzzer. The time constraint is five seconds. Five seconds is a really long time. But this system classifies as a real time system because it gives the expected output within the defined time constraint.

## Classifications of Real-Time Systems:

Now that we have gained an understanding of real-time systems, let’s see how they are classified.

### Definition: Soft Real-Time Systems

A soft real-time system is one in which performance is degraded but not destroyed by failure to meet response-time constraints.

Conversely, systems where failure to meet response-time constraints leads to complete or catastrophic system failure are called hard real-time systems.

### Definition: Hard Real-Time Systems

A hard real-time system is one in which failure to meet even a single deadline may lead to complete or catastrophic system failure.

### Definition: Firm Real-Time System

A firm real-time system is one in which a few missed deadlines will not lead to total failure, but missing more than a few may lead to complete or catastrophic system failure.

 System Real-Time Classification Explanation Avionics weapons delivery system in which pressing a button launches an air-to-air missile Hard Missing the deadline to launch the missile within a specified time after pressing the button may cause the target to be missed, which will result in catastrophe Navigation controller for an autonomous weedkiller robot Firm Missing a few navigation deadlines causes the robot to veer out from a planned path and damage some crops Console hockey game Soft Missing even several deadlines will only degrade performance

All practical systems minimally represent soft real-time systems. There is a lot of room for interpretation of hard, firm, and soft real-time systems. For example, in the automated teller machine, missing too many deadlines will lead to significant customer dissatisfaction and potentially even enough loss of business to threaten the existence of the bank. This extreme scenario represents the fact that every system can often be characterized any way—soft, firm, or hard—real-time by the construction of a supporting scenario. The careful definition of systems requirements (and, hence, expectations) is the key to setting and meeting realistic deadline expectations. In any case, it is a principal goal of real-time systems engineering to find ways to transform hard deadlines into firm ones, and firm ones into soft ones.

The following short video summarizes all the above concept: