Exception Safety in Parallel Algorithms

You launch 8 threads to process chunks of an array in parallel. Thread 3 throws an exception. What must your parallel framework handle?

A

The exception is silently discarded since threads have independent stacks

B

Nothing: exceptions in one thread automatically propagate to all other threads

C

The exception must be captured, other threads allowed to finish or be cancelled, and the exception must be rethrown in the calling thread

D

The OS kernel catches the exception and terminates all 8 threads