Submit the task to the forkjoin thread pool, the main thread calls the Get method waits for the child thread execution task, once the exception is thrown in a forkjoin child thread, And the child thread does not catch the exception, what happens to the main thread.
Much of the previous concern was that the Get method would throw timeoutexception, and that the Get method might actually throw interruptedexception and Executionexception, so what happens when these two exceptions are thrown?
When to throw interruptedexception.
Assuming that there are two threads T1 and T2, the T2 is created in the T1 thread, the T2 's Get method is called in the forkjointask thread, T1 T2 is invoked in the interrupt thread, and T2 is thrown interruptedexception exception.
When will the executionexception exception be thrown?
If an exception is thrown during a subtask that executes forkjoin , and the exception is not catch in a child thread, then the new Executionexception (ex) is passed in the Get method To wrap the exception in a executionexception type of exception.