I've read TBB flow graph conditional execution and have a slightly different problem.
Is it possible to create a node with multiple inputs and multiple outputs AND to control the execution by a conditional variable? Maybe without ugly casts.
I've attached a simple example how I would like to design the graph. How is the besst way to get it run with TBB flow graph?
start_node
sends astart_msg
tosome_node
if
start_msg
is empty,some_node
sends acontinue_msg
toend_node
, elsesome_node
sends acontinue_msg
to itself AND adata_msg
toend_node
if
continue_msg
is received bysome_node
, previous start_msg is checked if it's empty, if so, acontinue_msg
is send toend_node
, else adata_msg
is send.+--continue_msg--+ | | +-----+ +-----+ | | | | +----data_msg---+ v | / \ start_node --start_msg--> some_node end_node \ / +--continue_msg--+
One problem I'm dealing with: I can't say how many good elements are inside of start_msg
even is the size is known (let's say start_msg
holds a tbb::concurrent_vector<T>
. If some_node
finds a bad element, it will be ignored and some_node
is sending a continue_msg
to itself.