1

I am at the very start of a project where I plan to use the Intel Threading Building Block library in particular the Flow Graph part.

In that respect I have two questions:

  1. Is it possible to have nodes that have asynchronous input/output relations? For example, a special buffer node that will take some data input, and provide some output sporadically (e.g. computed stats)

  2. Is it possible to have nodes that sends different messages to succeeding nodes? Not a simple broadcast in other words.

Christophe
  • 68,716
  • 7
  • 72
  • 138

1 Answers1

2

Tor,

In both cases the node you want is a multifunction_node. The node will receive inputs like a regular function_node, and it has a tuple of output ports you can attach to (you can make the tuple have one element.)

The node receives messages but the action it takes does not necessarily require an output message.

I am not sure in the second point if you are asking about sending messages to different nodes, or if you are sending different types of messages to the same node. If it is the latter, you could use std::variant.

cahuson
  • 826
  • 4
  • 10
  • Thank you for your answer. I will have a look at the multifunction_node. As for your question - I did mean to send different messages to different nodes. – Tor Andre Myrvoll Mar 18 '19 at 08:57
  • 1
    You can also take a look at async_node, which was specifically designed for asynchronous input/output. However, it assumes that there is an asynchronous activity that will produce the input for async_node's successors. – Aleksei Fedotov Mar 18 '19 at 15:36