Name:
Location: Bangalore, Karnataka, India

I started off my career as a part-time IT trainer while I was in college. While I trained, I learned more on software. Now, I am trying to realize my dreams of building socially viable engineering solutions for consumers.

Friday, May 05, 2006

Real Time and Embedded

Many people seem to be confused with the difference between embedded systems and real time systems. Here is what I rekon:

Real Time Systems:
Have very "strict" timing constraints.
Ex.
1. Most common in books is missiles - if any timing in a missile programming is missed, it can hit the wrong target - but I will take something more common: like the fire alarm in our homes - the fire alarm has to be triggered as soon as it senses a fire so that showers can be trigerred - within a certain time period. Otherwise, it would result in fatal damages.

2. Think about electronically controlled car braking systems - they too are real time because the control loop of the brakes have to respond within a given time period - otherwise this can be fatal too!

Now - most of time, authors seem to give examples only pertaining to "fatal" real time systems. But there can be systems that are not fatal - yet need to work with deadlines for proper functioning.
Let us take the (hypothetical) case of an automated robot that is painting a car as soon as the body of the car arrives on its platform stands - in this case, the robot "must start" as soon as the car has arrived and "it must end" the painting within the stipulated amount of time. Otherwise, there can be loss because after the painting process, the car has to be passed along for further processing.
Any delay hence caused would be a disadvantage considering the "cost" of the production & productivity loss.
Hence, I would term Real Time systems as "any system" that has a very strict "deadline" constraint.
Remember:
Real time does NOT mean "Fast" - it just means "Deterministic"

Soft and Hard: What are they?

Soft Real Time: Is like a 'nice' boss looking over things - even if there are some errors, it would be acceptable for progressing with further processing. The simplest example I can think of is TV. Even if one video frame is dropped (where the atual requirement is minimum 25frames per second, say we receive only 24); the system can proceed without considering it as a "failure". Partial success is acceptable.

Hard Real Time: Is a strict boss commanding the system to be on schedule. There is a very strict threshold - meet it to survive or die! If the timing is not met - the system is considered "failed". Ex: If the missile does not hit the target on time, it is a complete failure.
Simpler example: A digital watch. If the clock is lagging or leading in time - it is a failure!
Partial success is not acceptable.

So what's the difference between Real Time and Embedded Systems?
Actually, Embedded and real time systems are "not opposites" as many of whom I know think of it so.
In common practice, people seem to refer to "Soft real time systems" as "embedded systems" and "hard real time systems" as "real time systems". As is the case you would have noticed when discussed about operating systems. uCLinux is considered an "embedded operating system" but VxWorks or uCos-ii is considered a "real time operating system".

There can be "real time systems" that are "not embedded" - meaning that there can be systems that have timing contraints, but not necessarily that are working to solve a specific problem (like a TV or camera).

Ex: Cricket scoreboard update in an autorefresh webpage. Assume that there is a cricket scoreboard webpage that automatically refreshes every 30seconds to update the score that is displayed.
Here, 30 seconds is the deadline for the real time "software" to display the correct result.

Consider the following happens:
Actual time score is published on website : 0, 30, 60, 90, 120, 150, 180
Actual Display time in Browser webpage : 0, 30, 60, 150, 180...

As you can see above, the score in second "90" gets displayed in second "150" - which is obviously a wrong result and is not up-to-date! This is a flaw.

The above is an example of a real time "software" used in a "generic browser" because the browser is NOT built to watch only cricket scores :) and is NOT an embedded system. But it is still real-time.

So - hereon, let me go with the general public: I will take "embedded" to mean "soft real time" and "real time" to mean "hard real time" systems.

0 Comments:

Post a Comment

<< Home