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

9.3 Task Dependence - Termination of Tasks

Dynamic Semantics
Each task (other than an environment task -- see 10.2) depends on one or more masters (see 7.6.1), as follows:
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.
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.
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:
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.

Example of task dependence:
          type Global is access Server;        --  see 9.1
          A, B : Server;
          G    : Global;
          --  activation of A and B
             type Local is access Server;
             X : Global := new Server;  --  activation of X.all
             L : Local  := new Server;  --  activation of L.all
             C : Server;
             --  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 --
Copyright statement
Page last generated: 95-03-12