tbb::this_task_arena::isolate() & tbb::parallel_for()

tbb::this_task_arena::isolate() & tbb::parallel_for()


Hi.

I read the document but I have one quesition.

Is it valid to always use tbb::this_task_arena::isolate() outside tbb::parallel_for()?
Rarely, deadlock occurs in the outer tbb::parallel_for().

tbb::this_task_arena::isolate([&]()
        {
            tbb::parallel_for(0, N1, [&](int i) // cause deadlock on here
                {
                    tbb::this_task_arena::isolate([&]()
                        {
                            tbb::parallel_for(0, N2, [](int j) { });
                        }
                    );
                })
        });

Thanks

1 post / 0 new