Hello,
Does TBB provide a mechanism for conditional parallelization?
For example, assume the following code, and I want to parallelize this loop only when loopCount is larger than 1000 (if not, execute sequentially to avoid unnecessary parallelization overhead).
for( int i = 0 ; i < loopCount ; i++ ) { /* do something */ }
I want to do
if( loopCount > 1000 ) { parallel_for(...) { ... } } else { for(...) { ... } }
without replicating the loop body. It will be very nice if I have something like "parallel_for_if" :-)
Thank you very much,



