Go to the first, previous, next, last section, table of contents.
-
The execution of an Ada program consists of the execution of one or more
tasks. Each task represents a separate thread of control that proceeds
independently and concurrently between the points where it interacts
with other tasks. The various forms of task interaction are described in
this section, and include:
-
the activation and termination of a task;
-
a call on a protected subprogram of a protected object, providing
exclusive read-write access, or concurrent read-only access to shared
data;
-
a call on an entry, either of another task, allowing for synchronous
communication with that task, or of a protected object, allowing for
asynchronous communication with one or more other tasks using that same
protected object;
-
a timed operation, including a simple delay statement, a timed entry
call or accept, or a timed asynchronous select statement (see next
item);
-
an asynchronous transfer of control as part of an asynchronous select
statement, where a task stops what it is doing and begins execution at a
different point in response to the completion of an entry call or the
expiration of a delay;
-
an abort statement, allowing one task to cause the termination of
another task.
-
In addition, tasks can communicate indirectly by reading and updating
(unprotected) shared variables, presuming the access is properly
synchronized through some other kind of task interaction.
Static Semantics
-
The properties of a task are defined by a corresponding task declaration
and task_body, which together define a program unit called a task unit.
Dynamic Semantics
-
Over time, tasks proceed through various states. A task is initially
inactive; upon activation, and prior to its termination it is either
blocked (as part of some task interaction) or ready to run. While ready,
a task competes for the available execution resources that it requires
to run.
NOTES
-
(1) Concurrent task execution may be implemented on multicomputers,
multiprocessors, or with interleaved execution on a single physical
processor. On the other hand, whenever an implementation can determine
that the required semantic effects can be achieved when parts of the
execution of a given task are performed by different physical processors
acting in parallel, it may choose to perform them in this way.
- 9.1: Task Units and Task Objects
- 9.2: Task Execution - Task Activation
- 9.3: Task Dependence - Termination of Tasks
- 9.4: Protected Units and Protected Objects
- 9.5: Intertask Communication
- 9.6: Delay Statements, Duration, and Time
- 9.7: Select Statements
- 9.8: Abort of a Task - Abort of a Sequence of Statements
- 9.9: Task and Entry Attributes
- 9.10: Shared Variables
- 9.11: Example of Tasking and Synchronization
-- The Detailed Node Listing ---
- 9.1: Task Units and Task Objects
- 9.2: Task Execution - Task Activation
- 9.3: Task Dependence - Termination of Tasks
- 9.4: Protected Units and Protected Objects
- 9.5: Intertask Communication
- 9.5.1: Protected Subprograms and Protected Actions
- 9.5.2: Entries and Accept Statements
- 9.5.3: Entry Calls
- 9.5.4: Requeue Statements
- 9.6: Delay Statements, Duration, and Time
- 9.7: Select Statements
- 9.7.1: Selective Accept
- 9.7.2: Timed Entry Calls
- 9.7.3: Conditional Entry Calls
- 9.7.4: Asynchronous Transfer of Control
- 9.8: Abort of a Task - Abort of a Sequence of Statements
- 9.9: Task and Entry Attributes
- 9.10: Shared Variables
- 9.11: Example of Tasking and Synchronization
Go to the first, previous, next, last section, table of contents.