... which seems pretty much what the exception handling behavior of the parallel collections does.
If exceptions of type A occur, either an exception of type A or an exception of type B, wrapping multiple exceptions of As, is observed.
Imho, this behavior is incredibly broken and so unintuitive, that even people writing tests don't handle it correctly. See files/run/t5375.scala.
Concerning �non-deterministic�:
How many exceptions are observed before the operation is aborted depends on the machine, the available cores and hyper-threading, the operating system, the threadpool implementation and configuration, the size of the collection and the runtime itself.
Is it just me or does this feel horribly wrong?
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
�
�
-- Aleksandar Prokopec, Doctoral Assistant LAMP, IC, EPFL http://people.epfl.ch/aleksandar.prokopec
Any parallel collection operation is non-deterministic in terms of its execution order.
It depends on the operator it is instantiated with if that nondeterminism is visible to the user or not.
A most notable example of this is probably `find` which may find different elements depending on the execution schedule.
However, philosophy aside, I cannot disagree with you that the CompositeException may not have been the best idea. Perhaps we should change that.
What would be the solution you suggest?
Cheers,
Alex
On 4/12/13 2:31 PM, Simon Ochsenreither wrote:
... which seems pretty much what the exception handling behavior of the parallel collections does.
If exceptions of type A occur, either an exception of type A or an exception of type B, wrapping multiple exceptions of As, is observed.
Imho, this behavior is incredibly broken and so unintuitive, that even people writing tests don't handle it correctly. See files/run/t5375.scala.
Concerning “non-deterministic”:
How many exceptions are observed before the operation is aborted depends on the machine, the available cores and hyper-threading, the operating system, the threadpool implementation and configuration, the size of the collection and the runtime itself.
Is it just me or does this feel horribly wrong?
--
You received this message because you are subscribed to the Google Groups "scala-internals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-interna...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
-- Aleksandar Prokopec, Doctoral Assistant LAMP, IC, EPFL http://people.epfl.ch/aleksandar.prokopec
--
I suggest returning some ParallelExecutionException in all cases. (Or have a look at the name/type Java chose for their implementation.) That way, the name doesn't imply whether it wraps one or multiple exceptions.
But returning multiple, structurally different exceptions non-deterministically is not acceptable, as demonstrated by the immediate test failure as soon as the test was run on non-HotSpot runtime.
I suggest returning some ParallelExecutionException in all cases. (Or have a look at the name/type Java chose for their implementation.) That way, the name doesn't imply whether it wraps one or multiple exceptions.
But returning multiple, structurally different exceptions non-deterministically is not acceptable, as demonstrated by the immediate test failure as soon as the test was run on non-HotSpot runtime.
Philosophy aside, tests often operate on a narrowly prescribed domain (as I just rediscovered in a different context).
If a test did not fail on another JVM, you might expect that the tests are inadequate.
--