[Ada Information Clearinghouse]

Ada '83 Quality and Style:

Guidelines for Professional Programmers

Copyright 1989, 1991,1992 Software Productivity Consortium, Inc., Herndon, Virginia.

CHAPTER 7: Portability

7.4 Tasking

The definition of tasking in the Ada language leaves many characteristics of the tasking model up to the implementor. This allows a vendor to make appropriate tradeoffs for the intended application domain, but it also diminishes the portability of designs and code employing the tasking features. In some respects this diminished portability is an inherent characteristic of concurrency approaches (see Nissen and Wallis 1984, 37).

A discussion of Ada tasking dependencies when employed in a distributed target environment is beyond the scope of this book. For example, multi-processor task scheduling, interprocessor rendezvous, and the distributed sense of time through package Calendar are all subject to differences between implementations. For more information, Nissen and Wallis (1984) and ARTEWG (1986) touch on these issues and (Volz et al. 1985) is one of many research articles available.

Language Ref Manual references: 9 Tasks

In this section...
7.4.1 Task Activation Order
7.4.2 Delay Statements
7.4.3 Package Calendar, Type Duration, and System.Tick
7.4.4 Select Statement Evaluation Order
7.4.5 Task Scheduling Algorithm
7.4.6 Abort
7.4.7 Shared Variables and Pragma Shared
Summary of Guidelines from this section


7.4.1 Task Activation Order

guideline

rationale

The order is left undefined in the Ada Language Reference Manual (Department of Defense 1983).

Language Ref Manual references: 9.3 Task Execution - Task Activation


7.4.2 Delay Statements

guideline

rationale

The rationale for this appears in Guideline 6.1.5. In addition, the treatment of delay statements varies from implementation to implementation thereby hindering portability.

Language Ref Manual references: 5.5 Loop Statements, 9.3 Task Execution - Task Activation, 9.6 Delay Statements, Duration, and Time


7.4.3 Package Calendar, Type Duration, and System.Tick

guideline

rationale

Such a correlation is not required, although it may exist in some implementations.

Language Ref Manual references: 9.6 Delay Statements, Duration, and Time, 13.7.1 System-Dependent Named Numbers, F Implementation-Dependent Characteristics


7.4.4 Select Statement Evaluation Order

guideline

rationale

The language does not define the order of these conditions, so assume that they are arbitrary.

Language Ref Manual references: 9.7.1 Selective Waits


7.4.5 Task Scheduling Algorithm

guideline

rationale

The Ada tasking model requires that tasks be synchronized only through the explicit means provided in the language (i.e., rendezvous, task dependence, pragma Shared). The scheduling algorithm is not defined by the language and may vary from time sliced to preemptive priority. Some implementations (e.g., VAX Ada) provide several choices that a user may select for the application.

note

The number of priorities may vary between implementations. In addition, the manner in which tasks of the same priority are handled may vary between implementations even if the implementations use the same general scheduling algorithm.

exceptions

In real-time systems it is often necessary to tightly control the tasking algorithm to obtain the required performance. For example, avionics systems are frequently driven by cyclic events with limited asynchronous interruptions. A nonpreemptive tasking model is traditionally used to obtain the greatest performance in these applications. Cyclic executives can be programmed in Ada, as can a progression of scheduling schemes from cyclic through multiple-frame-rate to full asynchrony (MacLaren 1980) although an external clock is usually required.

Language Ref Manual references: 9.3 Task Execution - Task Activation, 9.5 Entries, Entry Calls, and Accept Statements, 9.8 Priorities, B Predefined Language Pragmas


7.4.6 Abort

guideline

rationale

The rationale for this appears in Guideline 6.3.3. In addition, treatment of the abort statement varies from implementation to implementation thereby hindering portability.

Language Ref Manual references: 9.1 Abort Statements


7.4.7 Shared Variables and Pragma Shared

guideline

rationale

The rationale for this appears in Guideline 6.2.4. In addition, the treatment of shared variables varies from implementation to implementation thereby hindering portability.

Language Ref Manual references: 9.5 Entries, Entry Calls, and Accept Statements, 9.11 Shared Variables, B Predefined Language Pragmas


Back to document index