[concurrency-interest] Exception handling with ParallelArray

Neal Gafter neal at gafter.com
Fri Dec 28 08:50:03 EST 2007


On Dec 28, 2007 4:20 AM, Doug Lea <dl at cs.oswego.edu> wrote:

> 2. While we internally perform the cleanup and cancellation
>   across parallel threads executing the apply when any one of them
>   encounters an exception, we can't supply
>   any points at which you can locally handle the exception until
>   they complete, at which point any encountered (unchecked) exception
>   is rethrown. (Of course, if you can locally handle the
>   exception inside the Procedure, you don't need any of this anyway.)
>
> 3. Until/unless better support for disjunctive exception types
>   emerges, we can't nicely support methods that allow arbitrary
>   combinations of exceptions on Procedures etc, except by using
>   the Callable strategy which permits any exception. Which people
>   have grown to dislike, because it forces you to place try/catch
>   blocks around every call, even if you know that no handleable
>   exceptions are thrown. (Which in turn leads people to use empty
>   catches, which are much worse than not catching at all.) Given
>   (1) and (2) above though, it seems unlikely that we'd include
>   support for fancier exception types even if it becomes available.


I don't get it.  (2), above, seems like a reason to include fancier support
for exception tunneling (the generic exception type can be placed in the
throws clause of ParallelArray.apply), rather than a reason not to.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20071228/2f12ba58/attachment.html 


More information about the Concurrency-interest mailing list