Suggestions how to work with FIFO buffer at node's input

Suggestions how to work with FIFO buffer at node's input

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?

3 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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...

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.

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.

发表评论

登录添加评论。还不是成员?立即加入