Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

Pipeline parallelism in TBB flow graph

Michael3
Beginner
301 Views

Hello,

I am working on an image processing application which is built with tbb::flow_graph.
The input comes from a video file or a camera.
Each image processing node is wrapped in a multifunction_node (I need the multifunction_node's ability to selectively stop propagating graph messages).
Currently I am using graph.wait_for_all() after feeding each input frame into the root node, but I would like to be able to take advantage of pipeline parallelism.
I.e. if node A is connected to node B, I would like to let node A start working on its next input after it is done producing its output for B, instead of waiting for B to finish.

Could you please provide cues for how to do this efficiently and idiomatically?
I am new to TBB and I feel that I might be missing something obvious.

Thanks

0 Kudos
1 Reply
James_T_Intel
Moderator
160 Views

I apologize for the delayed response on your question.


I recommend using the async_node class. You can set up the async_node to process node A's input while node B is still waiting. See https://www.threadingbuildingblocks.org/docs/help/reference/flow_graph/async_node_cls.html for details.


I am closing this thread for Intel support. Any future replies will be considered community only.


Reply