Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I have read the definitions for the different notions of real-time, and the examples provided for hard and soft real-time systems make sense to me. But, there is no real explanation or example of a firm real-time system. According to the link above:

Firm: Infrequent deadline misses are tolerable, but may degrade the system's quality of service. The usefulness of a result is zero after its deadline.

Is there a clear distinction between firm real-time vs. hard or soft real-time, and is there a good example that illustrates that distinction?

In comments, Charles asked that I submit tag wikis for the new tags. The example of a "firm real-time system" I provided for the tag was a milk serving system. If the system delivers milk after its expiration time, then the milk is considered "not useful". One can tolerate eating cereal without milk, but the quality of the experience is degraded.

This is just the idea I formed in my head when I initially read the definition. I am looking for a much better example, and perhaps a better definition of firm real-time that will improve my notion of it.

share|improve this question
3  
Basically, the definitions aren't real firm. – Hot Licks Jun 26 '13 at 0:00
    
I restored the original tags. I think it is useful to be able to place a more specific tag on a question with regards to hard or soft real-time. It changes the way the question gets answered. The tags will get removed automatically anyway if the tags don't get used after 6 months. – jxh Jun 26 '13 at 0:26
    
If you're going to insist on three new tags for this question and this question alone, at least add wikis and try to find other questions to which they would apply. – Charles Jun 26 '13 at 15:33

10 Answers 10

up vote 36 down vote accepted

Hard real-time means you must absolutely hit every deadline. Very few systems have this requirement. Some examples are nuclear systems, some medical applications such as pacemakers, a large number of defense applications, avionics, etc.

Firm/soft real time systems can miss some deadlines, but eventually performance will degrade if too many are missed. A good example is the sound system in your computer. If you miss a few bits, no big deal, but miss too many and you're going to eventually degrade the system. Similar would be seismic sensors. If you miss a few datapoints, no big deal, but you have to catch most of them to make sense of the data. More importantly, nobody is going to die if they don't work correctly.

The line is fuzzy, because even a pacemaker can be off by a small amount without killing the patient, but that's the general gist.

It's sort of like the difference between hot and warm. There's not a real divide, but you know it when you feel it.

share|improve this answer
    
Your "firm" example seems "soft" to me. – jxh Jun 25 '13 at 23:48
    
As noted, the dividing lines are pretty fuzzy. The one soft realtime system I worked on had tolerances of a few seconds, so that's where I draw the line. – Joel Jun 26 '13 at 0:18
    
Keep in mind that it's a continuum. Virtually every computer system is "real time" on some time scale. A company's billing system must get the bills out sufficiently fast to maintain cash flow into the company or the company will die, just a surely as a patient will die if a pacemaker misses beats by a few hundred milliseconds. – Hot Licks Jun 26 '13 at 0:37
    
I understand that missed deadlines may be tolerable for some systems, but that is my understanding of a soft real-time system. I am looking for a practical example of the criteria: The usefulness of a result is zero after its deadline. I guess for your sound example, if the sound is synchronized to a video stream, then some late arriving audio packets will have zero usefulness? But there are some movie playback systems that speed-up the audio to catch up to the video. – jxh Jun 26 '13 at 1:12
    
The real time requirements are in the context of a given system, not inherent to the problem. In the example you give, there is still damage to the sound(it's sped up), and a temporary mismatch in the sound and video. – Joel Jun 26 '13 at 4:24

After reading the Wikipedia page and other pages on real-time computing. I made the following inferences:

1> For a Hard real-time system, if the system fails to meet the deadline even once the system is considered to have Failed.

2> For a Firm real-time system, even if the system fails to meet the deadline, possibly more than once (i.e. for multiple requests), the system is not considered to have failed. Also, the responses for the requests (replies to a query, result of a task, etc.) are worthless once the deadline for that particular request has passed (The usefulness of a result is zero after its deadline). A hypothetical example can be a storm forecast system (if a storm is predicted before arrival, then the system has done its job, prediction after the event has already happened or when it is happening is of no value).

3> For a Soft real-time system, even if the system fails to meet the deadline, possibly more than once (i.e. for multiple requests), the system is not considered to have failed. But, in this case the results of the requests are not worthless value for a result after its deadline, is not zero, rather it degrades as time passes after the deadline. Eg.: Streaming audio-video.

Here is a link to a resource that was very helpful.

share|improve this answer
1  
The storm forecast system is not a good example, because you need to set a deadline based on time, and if you already knew when the earliest time a storm might happen by, the storm forecast system is kind of redundant. – jxh Feb 20 '14 at 15:59

The hard real-time definition considers any missed deadline to be a system failure. This scheduling is used extensively in mission critical systems where failure to conform to timing constraints results in a loss of life or property.

Examples:

Air France Flight 447 crashed into the ocean after a sensor malfunction caused a series of system errors. The pilots stalled the aircraft while responding to outdated instrument readings. All 12 crew and 216 passengers were killed.

Mars Pathfinder spacecraft was nearly lost when a priority inversion caused system restarts. A higher priority task was not completed on time due to being blocked by a lower priority task. The problem was corrected and the spacecraft landed successfully.

An Inkjet printer has a print head with control software for depositing the correct amount of ink onto a specific part of the paper. If a deadline is missed then the print job is ruined.

The firm real-time definition allows for infrequently missed deadlines. In these applications the system can survive task failures so long as they are adequately spaced, however the value of the task's completion drops to zero or becomes impossible.

Examples:

Manufacturing systems with robot assembly lines where missing a deadline results in improperly assembling a part. As long as ruined parts are infrequent enough to be caught by quality control and not too costly, then production continues.

A digital cable set-top box decodes time stamps for when frames must appear on the screen. Since the frames are time order sensitive a missed deadline causes jitter, diminishing quality of service. If the missed frame later becomes available it will only cause more jitter to display it, so it's useless. The viewer can still enjoy the program if jitter doesn't occur too often.

The soft real-time definition allows for frequently missed deadlines, and as long as tasks are timely executed their results continue to have value. Completed tasks may have increasing value up to the deadline and decreasing value past it.

Examples:

Weather stations have many sensors for reading temperature, humidity, wind speed, etc. The readings should be taken and transmitted at regular intervals, however the sensors are not synchronized. Even though a sensor reading may be early or late compared with the others it can still be relevant as long as it is close enough.

A video game console runs software for a game engine. There are many resources that must be shared between its tasks. At the same time tasks need to be completed according to the schedule for the game to play correctly. As long as tasks are being completely relatively on time the game will be enjoyable, and if not it may only lag a little.

Siewert. Real-Time Embedded Systems and Components.

Liu & Layland. Scheduling Algorithms for Multiprogramming in a Hard Real-Time Environment.

Marchand & Silly-Chetto. Dynamic Scheduling of Soft Aperiodic Tasks and Periodic Tasks with Skips.

share|improve this answer
1  
what an enjoyable list of examples! – Erik Allik Nov 20 '15 at 18:35
    
One of the best examples – Vishnu N K Sep 15 at 10:11

It's popular to associate some great catastrophe with the definition of hard real-time, but this is not relevant. Any failure to meet a hard real-time constraint simply means that the system is broken. The severity of the outcome when something is labelled "broken" isn't material to the definition.

Firm and soft simply fail to be automatically declared broken on failing to meet a single deadline.

For a fair example of hard real-time, from the page you linked:

Early video game systems such as the Atari 2600 and Cinematronics vector graphics had hard real-time requirements because of the nature of the graphics and timing hardware.

If something in the video generation loop missed just a single deadline then the whole display would glitch, which would be intolerable, even if it was rare. That would be a broken system and you'd take it back to the shop for a refund. So it's hard real-time.

Obviously any system can be subject to situations it cannot handle, so it's necessary to restrict the definition to being within the expected operating conditions -- noting that in safety-critical applications people must plan for terrible conditions ("the coolant has evaporated", "the brakes have failed", but rarely "the sun has exploded").

And lets not forget that sometimes there's an implicit "while anybody is watching" operating condition. If nobody sees you break the rules (or if they did but they die the fire before telling anyone), and nobody can prove that you broke the rules after the fact, then it's kind of the same as if you never broke the rules!

share|improve this answer
1  
If nobody sees you break the rules (or if they did but they die the fire before telling anyone), and nobody can prove that you broke the rules after the fact, then it's kind of the same as if you never broke the rules! ... Ok, HAL. Now, can you please open the pod bay doors? – Basic Oct 25 '15 at 15:15

A soft real time is easiest to understand, in which even if the result is obtained after the deadline, the results are still considered as valid.

Example: Web browser- We request for certain URL, it takes some time in loading the page. If the system takes more than expected time to provide us with the page, the page obtained is not considered as invalid, we just say that the system's performance wasn't up to the mark (system gave low performance!).

In hard real time system, if the result is obtained after the deadline, the system is considered to have failed completely.

Example: In case of a robot doing some job like line tracing, etc. If a hindrance comes on its path, and the robot doesn't process this information within some programmed deadline (almost instant!), the robot is said to have failed in its task (the robot system may also get completely destroyed!).

In firm real time system, if the result of process execution comes after the deadline, we discard that result, but the system is not termed to have been failed.

Example: Satellite communication for enemy position monitoring or some other task. If the ground computer station to which the satellites send the frames periodically is overloaded, and the current frame (packet) is not processed in time and the next frame comes up, the current packet (the one who missed the deadline) doesn't matter whether the processing was done (or half done or almost done) is dropped/discarded. But the ground computer is not termed to have completely failed.

share|improve this answer

Do a Google search on "time-utility function" (or go to Binoy Ravindran's web page at VA Tech and look at the papers and theses in 2006-2011 http://www.ssrg.ece.vt.edu/allpapers.php. There is a more focused set of about 100 papers on time-utility functions on my web site www.real-time.org but I have that site in maintence mode while I re-implement it.

These papers have (a subset of brief) precise definitions of the terms being discussed here (and in the mess that the Wikipedia pages on real-time are). The point is that there is a formal model for timeliness in which the various confused and inaccurate definitions of "real-time," "hard real-time," "soft real-time," etc. are precisely clarified and seen to be special cases of time-criticality. The time-critical model also encompasses timeliness (including deadlines, hard, soft, etc.) as widely used outside the real-time computing community. The model also formally clarifies the misunderstood and confused terms "predictability" and "determinism." Examples are provided of using time/utility functions (and utility accrual scheduling) where conventional (confused) "real-time" concepts and technologies would traditionally be attempted and be insufficient.

share|improve this answer

The simplest way to distinguish between the different kinds of real-time system types is answering the question:

Is a delayed system response (after the deadline) is still useful or not?

So depending on the answer you get for this question, your system could be included as one of the following categories:

  1. Hard: No, and delayed answers are considered a system failure

This is the case when missing the dead-line will make the system unusable. For example the system controlling the car Airbag system should detect the crash and inflate rapidly the bag. The whole process takes more or less one-twenty-fifth of a second. Thus, if the system for example react with 1 second of delay the consequences could be mortal and it will be no benefit having the bag inflated once the car has already crashed.

  1. Firm: No, but delayed answers are not necessary a system failure

This is the case when missing the deadline is tolerable but it will affect the quality of the service. As a simple example consider a video encryption system. Normally the password of encryption is generated in the server (video Head end) and sent to the customer set-top box. This process should be synchronized so normally the set-top box receives the password before starts receiving the encrypted video frames. In this case a delay it may lead to video glitches since the set-top box is not able to decode the frames because it hasn't received the password yet. In this case the service (film, an interesting football match, etc) could be affected by not meeting the deadline. Receiving the password with delay in this case is not useful since the frames encrypted with the same have already caused the glitches.

  1. Soft: Yes, but the system service is degraded

As from the the wikipedia description the usefulness of a result degrades after its deadline. That means, getting a response from the system out of the deadline is still useful for the end user but its usefulness degrade after reaching the deadline. A simple example for this case is a software that automatically controls the temperature of a room (or a building). In this case if the system has some delays reading the temperature sensors it will be a little bit slow to react upon brusque temperature changes. However, at the end it will end up reacting to the change and adjusting accordingly the temperature to keep it constant for example. So in this case the delayed reaction is useful, but it degrades the system quality of service.

share|improve this answer

real-time - Pertaining to a system or mode of operation in which computation is performed during the actual time that an external process occurs, in order that the computation results can be used to control, monitor, or respond to the external process in a timely manner. [IEEE Standard 610.12.1990]

I know this definition is old, very old. I can't, however, find a more recent definition by the IEEE (Institute of Electrical and Electronics Engineers).

share|improve this answer
2  
Actually, 1990 is not old at all. I was having this discussion in the 70s, and the definition was roughly the same. – Hot Licks Jun 26 '13 at 0:38

Maybe the definition is at fault.

From my experience, I would separate the two as being hardware and software dependant.

If you have 200ms to service a hardware driven interrupt, that is what you've got. You stick 300ms of code in there and the system isn't broken, it hasn't been developed. You'll be switched out before you've finished. Your code doesn't work or is not fit for purpose. Many systems have hard defined processing periods. Video, telecoms etc.

If you're writing an application that's real-time, this could be considered soft. If you run out of time you could hope for less load next time, you could tune the OS, add some memory or even upgrade the hardware. You have options.

To look at it from a UX perspective is not helpful. A Skoda might not be broken if it glitches, but a BMW sure as hell will be.

share|improve this answer
    
what do you have against Škodas! – Erik Allik Nov 20 '15 at 18:37

Hard real time systems are very likely to be in pinpoint precision accurate. These systems should not fail but if they fail it will be a disaster. Examples: auto pilot, fire alarm systems.

Soft real time systems can fail a job once or twice. Examples: audio video streaming (youtube, steam broadcast)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.