DocAda(tm) is a productivity tool of KSCE

Prev | Up | Next | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

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.

Examples

Example of task dependence:

    
       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

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | Next | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com