I have a set of objects that I want to process in parallel. The results of this should have further processing done in serial. The gist of it is:
tbb::make_filter<T,U>( tbb::filter::parallel, MyInputFunc(input_file) )
& tbb::make_filter<U,V>( tbb::filter::serial_out_of_order, MyTransformFunc() )
However, for some of the U objects, before the serial processing can start, there needs to be further processing done on child objects of it in parallel. One way to solve this would be to have a feeder into the first filter, if that's possible, and generalize it to work on T objects or on children of U objects. Another would be to have parallel_do for each U's child objects, but I don't know if that will typically introduce a lot of performance overhead. Any ideas?
It seems that you don't need parallel_do() in your task. Since additional work appears at the time of U creation (the initial stage of the pipeline), then it can be performed in the same place. Nested parallelism can be used in this context. For a solution, you can use parallel_for() or task_group(): “run + wait” inside the initial stage of the pipeline.
I think I answered your question and I'm closing this case for now. Just create an new case if you would like to continue investigation or if you have a new issue.
Thank you very much!