We have a program where we want to get an answer back from a set of experiments. Based on the data set given in each experiment will either fail, or take longer than the others. Right now we are locked into a fixed order to run the experiments and stop after one completes successfully.
My goal is to run each of the experiments in parallel and when the first one completes and has valid data to kill off the other ones and stop wasting processor time since we already have the answer. This is not really a parallel_for type of problem, more like a task based problem. Ideally I would like to take each experiment and in turn make them run in parallel for better performance.
Is there any good way of a task telling the scheduler to stop the other sibling tasks and any additional tasks that they generated? or am I stuck writing this myself using pthreads?