- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A question on tbb:flow. What is the right strategy to use internal FIFO buffer at the input of the function_node?
Imagine a pipeline source_node -> function_node -> function_node -> ..... By default function_node has an infinite buffer in front of it. I am affraid that source_node may overproduce data and the data will consume to much RAM, before everything is processed. What is the right way to control this issue?
I've tried to set all function_node-s as "rejecting". This caused loosing some of the messages. Is it an intentional behavior if node rejects messages or I should seek a bug in my code?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You should probably use a limiter_node as described here: https://software.intel.com/en-us/blogs/2011/09/14/how-to-make-a-pipeline-with-an-intel-threading-building-blocks-flow-graph
The Flow Graph "Rejecting" strategy seems to be inherently flawed. When using TBB Flow Graph, from what I can see, you should always use queueing nodes with unlimited concurrency, otherwise you can get weird behaviour.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your answer!
I think I got the idea. The TBB manual says that function_node.try_get() always returns false. "A function_node does not contain buffering of its output. Therefore it always rejects try_get calls." That's why nobody should reject messages after function_node.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page