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

TBB flow/dependency graph and work isolation

DimitriosMakris
Beginner
205 Views

Hi,

 

How can we achieve work isolation among the nodes of a dependency graph or generally a flow graph? I am defining the node as :

tbb::flow::continue_node<tbb::flow::continue_msg> nd (g,[=](const tbb::flow::continue_msg &msg)

{

   int tid = tbb:this_task_arena::current_thread_index();

  tbb::this_task_arena::isolate([& {

    // do some work with nested parallelism or nested subgraphs

    });

});

 

Defining a node as above and using isolate does not prevent tid to get when idle other nodes of the graph? How can we prevent tid to jump out of this node? 

 

Thank you. 

 

0 Kudos
1 Reply
Mark_L_Intel
Moderator
89 Views

The thread should stay in the isolated arena. If it does not, something is wrong in which case please provide a complete reproducer. For general reference, please see Chapter 12, "Creating an Isolated Region ..." in pro TBB  book freely avaibale for download.    

0 Kudos
Reply