Time-driven programming

From Wikipedia, the free encyclopedia

Time-driven programming is a computer programming paradigm, were the control flow of the computer program is driven by a clock. A program is divided into a set of tasks (i.e., processes or threads), which has a periodic activation pattern. The activation pattern for all tasks is stored in a dispatch table, were the Least-Common-Multiple (LCM) of all period-times determines the length of the dispatch table. The scheduler of the program dispatches all tasks according to the dispatch table, on which end a new instance of the dispatch table is initiated.

The programming paradigm is mostly used for safety critical programs, since the behaviour of the program is highly deterministic. No external events is allowed to affect the control-flow of the program, the same pattern (i.e., described by the dispatch table) will be repeated time after time.

The drawback with the method is that the program becomes static, and unsuitable for applications requiring a large amount of flexibility.