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 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles; site gypsy.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!siemens!gypsy!emery From: emery@gypsy.UUCP Newsgroups: net.lang.ada Subject: Re: Propagation of exceptions raised wit Message-ID: <38000028@gypsy.UUCP> Date: Wed, 4-Jun-86 10:13:00 EDT Article-I.D.: gypsy.38000028 Posted: Wed Jun 4 10:13:00 1986 Date-Received: Sat, 7-Jun-86 04:26:25 EDT References: <325@cernvax.UUCP> Nf-ID: #R:cernvax:-32500:gypsy:38000028:000:2363 Nf-From: gypsy!emery Jun 4 10:13:00 1986 List-Id: I think you are asking "Why don't exceptions propogate out of tasks?" If so, don't feel bad, I asserted that they do once in public, and was quickly corrected. Exceptions do not propogate out of tasks. If a task raises an exception that it doesn't handle, the task becomes 'completed', but no further action (including propogating the exception) takes place. Quotes from the Canon: Ada RM, section 11.4.1 "If an exception is raised in the sequence of statements of a frame that does not have a handler for the exception, execution of the sequence of statements is abandoned. The next action depends on the nature of the frame: (a) For a subprogram body, the same exception is raised again at the point of call of the subprogram, unless the subprogram is the main program itself, in which case execution of the main program is abandoned. (b) For a block statement, the same exception is raised again immediately after the block statement (that is, within the innermost enclosing frame or accept statement). (c) For a package body that is a declaritive item, the same exception is raised again immediately after this declarative item (within the enclosing declarative part). If the package body is that of a subunit, the exception is raised again at the place of the corresponding body stub. If the package is a library unit, execution of the main program is abandoned. (d) For a task body, the task becomes completed. An exception that is raised again (as in the above cases (a), (b), (c)) is said to be propogated, either by the execution of the subprogram, the execution of the block statement, or the elaboration of the package body. No propogation takes place in the case of a task body. If the frame is a subprogram or a block statement and if it has dependent tasks, the propogation of an exception takes place only after termination of the dependent tasks. Finally, if an exception is raised in the sequence of statements of an exception handler, execution of this sequence of statements is abandoned. Subsequent actions (including propogation, if any) are as in the cases (a) to (d), above." So, here's an interesting design problem: How does a task report failure due to an exception to its parent? Dave Emery Siemens Research UUCP: ...princeton!siemens!emery ARPA: princeton!siemens!emery@topaz.rutgers.edu