Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
2466 Discussions

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

ozawa__yuki
Beginner
463 Views

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

0 Kudos
0 Replies
Reply