[net.lang.ada] Propagation of exceptions raised in tasks

sigurd@oslo.uio.edu (Sigurd Meldal) (06/10/86)

Ben Brosgol writes
> The problems with asynchronous exceptions are why exceptions do not propagate
> out of tasks.  That is, there is no way of knowing where the parent task
> is when the child task raises the exception.  Asynchronous exception raising
> would be an unreliable and hard to implement means of synchronization.  So,
> sorry about the lack of symmetry between tasks and other units with
> respect to exception propagation, but tasks are different in an essential way
> here.

However, there is at least one well-defined point to which an exception
raised in a task could be propagated. Since a block statement, task
etc. which has dependent tasks is not terminated unless all dependent
tasks are completed, we have a synchronization point at the end of this
master (LRM 9.4). One might lay down the rule that an exception
propagated out of a task is handled by a handler of the direct
master of the task raising the exception, in effect interrupting the
master. One would probably have to insist that the propagation
of an exception out of a task kills all tasks dependent on the master
handling the exception, a rather heavy-handed treatment if
synchronization is the issue, but reasonable if exceptions really are
exceptional and are treated as such.


Sigurd Meldal

Hard mail: Institute of Informatics    	| ARPA: sigurd@oslo-vax.arpa
	   University of Oslo		|	
	   pob. 1080 Blindern		|
	   N - 0316 Oslo 3		|
	   Norway.			|