General AMX Operation
K
DAK
9
2. General AMX Operation
2.1 Introduction to Multitasking
A real-time system is characterized by the need to respond rapidly to events occurring
asynchronously in time. A multitasking system is one in which a number of activities or
processes must be performed simultaneously without interference with each other. A
system in which several activities must operate simultaneously with time-critical
precision is called a real-time multitasking system.
The AMX Multitasking Executive provides a simple solution to the
complexity of real-
time multitasking. AMX supervises the orderly execution of a set of application program
modules called tasks. Each task solves a particular problem and provides a specific
functional capability within the system.
As we all know, the microprocessor can only do one thing at a time. Fortunately, it does
all things very quickly. However, to get the effect that all activities are occurring
simultaneously, it is necessary to rapidly switch back and forth from one process to
another in a well controlled fashion. It is AMX which organizes and controls the use of
the microprocessor to achieve this apparent concurrent execution of tasks.
Each task solves a particular problem or provides a specific functional capability within
the system. Each task executes independent of other tasks. Facilities are provided,
however, to permit tasks to co-operate to achieve a common goal. This process in which
more than one task is allowed to share the use of a single processor is called multitasking.
The software program which makes it possible is AMX.
What a task does is completely application dependent. In fact, the most difficult aspect
of system design is to logically break the problem into a set of tasks which, if
implemented, will achieve the desired goal. The following example is presented to
illustrate one way in which a simple real-time alarm logging system can be implemented.
Example
Assume that it is necessary to periodically scan a set of digital alarm inputs. When any
alarm is detected, a message is to be logged on a printer. The message is to include a
description of the alarm and the time of day at which it occurred.
Careful examination of this problem indicates that in fact it is three problems. First, a set
of digital inputs must be scanned for the detection of alarms. Second, a message must be
printed. Finally, the time of day must be maintained for inclusion in the message.
Three problems usually result in three tasks. Our example is no exception. A time of day
task is required to maintain the date and time within the system. The task must be
executed once each second if time is to be maintained to the nearest second. We will
ignore the requirement to somehow set the proper time and date. (Isn't that another task?)