Building flexible real-time systems

Programs for hard real-time systems have stringent timing requirements. Real-time programs are usually designed for the worst-case situation, which makes them inefficient. We argue that real-time programs should be more flexible, resulting in systems which can respond to dynamic environments. Normally, when the program has all the resources it needs, it produces a good, precise result. When some of the resources are not available the program may produce approximate, imprecise results. We describe our attempts to attain this objective. One approach is to add primitives to an existing language to implement the milestone and sieve techniques. In the milestone technique procedures record their partial results periodically, and return the latest result available if the deadline is reached. The sieve technique skips certain sections of code if the time available is not sufficient. Our second attempt involves the design of a new real-time language called FLEX. FLEX provides the ability to express and enforce timing and resource requirements using constraints. Imprecise functions and exception handling are used to produce imprecise results when the resources available are inadequate. FLEX also provides ways to represent and manipulate imprecise values, to facilitate processing of the imprecise results. We discuss implementation techniques, and show an example FLEX program.