Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help


9.3 Task Dependence - Termination of Tasks

Dynamic Semantics
(1)
Each task (other than an environment task -- see 10.2) depends on one or more masters (see 7.6.1), as follows:
(2)
(3)
(4)
Furthermore, if a task depends on a given master, it is defined to depend on the task that executes the master, and (recursively) on any master of that task.
(5)
A task is said to be completed when the execution of its corresponding task_body is completed. A task is said to be terminated when any finalization of the task_body has been performed (see 7.6.1). The first step of finalizing a master (including a task_body) is to wait for the termination of any tasks dependent on the master. The task executing the master is blocked until all the dependents have terminated. Any remaining finalization is then performed and the master is left.
(6)
Completion of a task (and the corresponding task_body) can occur when the task is blocked at a select_statement with an an open terminate_alternative (see 9.7.1); the open terminate_alternative is selected if and only if the following conditions are satisfied:
(7)
(8)
(9)
When both conditions are satisfied, the task considered becomes completed, together with all tasks that depend on the master considered that are not yet completed.

(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18)
Examples
(19)
Example of task dependence:
(20)
       declare
          type Global is access Server;        --  see 9.1
          A, B : Server;
          G    : Global;
       begin
          --  activation of A and B
          declare
             type Local is access Server;
             X : Global := new Server;  --  activation of X.all
             L : Local  := new Server;  --  activation of L.all
             C : Server;
          begin
             --  activation of C
             G := X;  --  both G and X designate the same task object
             ...
          end;  --  await termination of C and L.all (but not X.all)
          ...
       end;  --  await termination of A, B, and G.all


Prev | Up | Next | Back | Forward
TOC -- / --.-- / --.--.-- | Index | Search | Syntax | Help

Ada WWW Home -- Email comments, additions, corrections, gripes, kudos, etc. to:

Magnus Kempe -- Magnus.Kempe@di.epfl.ch
Copyright statement
Page last generated: 95-03-12