发信人: bigapple (红富士), 信区: NTM
标  题: (RT-Linux-1)What is Real-time? 
发信站: 哈工大紫丁香 (Wed Jun 21 09:06:39 2000) , 站内信件

What is Real-time? 

Before introducing RT-Linux it is necessary to overview a few ideas concerning
 Real Time. We will say that: 
" A Real Time System is an information system whose correction does not only d
epend on the logical output of the algorithms but also on the moment in time w
hen these output occurred ." 

It is not sufficient that the resulting output is correct, this output must be
 reached within a specified time interval. Notice from this definition that a 
real time system is not necessarily fast, as one could be lead to believe. For
 example: the guidance system of a ship may appear at first to be a non real t
ime system, because its speed is low and usually one has "enough" time (of the
 order of minutes) to take a control decision. Nevertheless, according to our 
definition it is effectively a RT system. 

Notice what we have defined is a "Real Time System" and not a System in Real T
ime. "System in Real Time" are generally rapid systems capable of giving the i
mpression of "reality". Typically all the simulations and interactive games ne
ed to give the user the appearance of time continuity and the most images gene
rated per unit time the best. 

Let us next consider in more detail the concept of "temporal restriction". Sup
pose one wants to control the velocity of an engine subject to a variable load
, and that one wants to perform a PID control (Proportional- Integral-Derivati
ve). The PID control, from our point of view, is a function that takes a numbe
r of parameters -- in this example, the velocity of the engine -- and returns 
the value of the control signal that has to be applied to the engine -- the vo
ltage that must be fed to the engine. The theory behind the design of PID algo
rithms, which by the way is extensive, assumes that the computational time is 
negligible, that is, the time from reading the speed of the engine until the t
ime when we act is very small. Under normal circumstances systems allow for a 
small delay time. Another characteristic of this type of control is that it mu
st be executed periodically, in other words, the PID algorithm must be execute
d regularly. If the time between two consecutive calls to the PID function is 
too large, then the engine may reach an undesirable velocity. Summarising: The
 PID function can be viewed as a program that must be executed periodically (P
i); from the starting time until the time of completion must last a time inter
val no larger than a maximum specified by the design of the PID (Di) and accor
ding to the speed of the processor the PID code requires certain amount of tim
e (Ci). 

Pi: Period of Task i.

Di: Deadline for task i.

Ci: worse case Computational time for task i.

If the system is made up of a single task, then there is no problem of real-ti
me: either the processor can run the process in the required time or not. In c
ase the processor is not sufficiently fast one just replaces the CPU for a fas
ter one.

The RT problems appear when the system is made up of a number of tasks and the
re is need to divide the processor (or processors) power among them. This prev
ents us from using a classical shared time system like Linux . Of course, it i
s hardly necessary to mention not to even try to write programs requiring real
 time under Windows.... An even better advice is not write any sort of program
 under that platform.

Not all the real-time systems are identical, it is not the same to control the
 ABS breaking system of a car and the combustible injection system in an aircr
aft engine or the decompression and visualisation of an mpeg file. In the firs
t case, a small delay in the execution time may cause the loss of human life o
r grave material loses; in the second case, there is simple degradation of the
 quality of the system (the image may remain frozen and some photograms could 
be lost). The first type of systems are known as Hard Real-Time Systems , and 
the second type Soft Real-Time System. We will concentrate our discussion to h
ard real-time systems.

The design of a real-time system goes through several phases: First the tasks 
to be performed and the temporal restrictions that must be satisfied are ident
ified, Secondly the code is written and Finally the run-time of each task is m
easured and a schedulability test is done to ensure that the task will not mis
s its deadline while the system is running. The schedulability test consists o
n applying a number of tests to the whole set of tasks, and if they pass the t
ests then it will be possible to warranty that no task will loose its deadline
. If the tests are not passed it is necessary to start our design again from t
he beginning, picking a faster CPU or using other algorithms to implement the 
tasks. 

In summary: The tasks are identified with three time values: Pi , Di and Ci. T
he objective of the system is to warranty that all tasks (in all their executi
ons) will satisfy their deadlines. To warranty execution times the system must
 be predictable . Saying that a system is real-time or that the system is pred
ictable is 

--
※ 来源:.哈工大紫丁香WWW bbs.hit.edu.cn. [FROM: 203.123.8.4] 
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:6.369毫秒