From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!IBM.COM!NCOHEN From: NCOHEN@IBM.COM (Norman Cohen) Newsgroups: comp.lang.ada Subject: Two Questions on tasking Message-ID: <040389.093152.ncohen@ibm.com> Date: 3 Apr 89 13:31:52 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Ref: INFO-ADA Digest Volume 89 Issue 96 (Sat, Apr 1, 1989) Item #5 Bob Hathaway writes: >According to section 9.3.3, if any child task does not have a handler >for a raised exception, the exception TASKING_ERROR is propagated to the >master upon conclusion of the activation of all sibling tasks and is >propagated to the master only once for any number of concluded child >tasks. What is being asserted above? Paragraph 9.3(3) refers to exceptions arising during the ACTIVATION of a task. Activation is defined in 9.3(1) as follows: The initial part of this execution [of a task body] is called the _activation_ of the task object, and also that of the designated task; it consists of of the elaboration of the declarative part, if any, of the task body. To understand the rules given in paragraphs 9.3(2) and 9.3(3), consider the following example: declare A, B : Some_Task_Type; C : array (1 .. 10) of Some_Task_Type; begin -- (*) S; end; (Some_Task_Type is some task type.) Twelve task objects (A, B and C(1) through C(10)) are declared in the declarative part of the block statement. The following events occur: 1. After the task executing the block statement reaches the point marked (*), the task pauses, and twelve new tasks are now created to be designated by the twelve declared task objects. 2. Each of these twelve new tasks asynchronously executes the declarative part of the Some_Task_Type task body (or dies trying). 3. THE TWELVE NEW TASKS AND THE TASK EXECUTING THE BLOCK STATEMENT ALL SYNCHRONIZE. If one or more of the twelve new tasks died trying to elaborate its declarative part (i.e., raised an exception), TASKING_ERROR is raised (once) in the block statement, at point (*). Otherwise, after synchronizing, the twelve new tasks and the task executing the block statement begin asynchronous execution (with execution of the block statement resuming at point (*)). If any of the twelve new tasks raises an unhandled exception AFTER this synchronization point, no exception is propagated to the task executing the block statement. Norman Cohen