'par f g' should do the following things:
- Create a node for the results of evaluating the two arguments.
- Start two threads which concurrently evaluate 'f nop' and 'g nop' which place their results in the node after being evaluated. Note, a dummy argument is necessary since otherwise both arguments would be fully reduced.
- Block until the arguments are fully reduced.
Then there is exception handling. What to do if either thread returns an exception? There are two solutions.
- The simplistic manner. Just place the exception thrown in the result node.
- The right manner. As soon as either thread throws an exception, stop the other thread, and throw that exception upward.
There are no users, I expect no users, I'll do the simplistic manner.
No comments:
Post a Comment