- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the TBB book shows us an example "packet processing pipeline" which implement with TBB pipeline.
if I understand correctly, the pipeline need to create a new obj(filter) frequently with C++ new primitive, so if the filter has complex data member,it might take a huge time to do that?
if I understand correctly, the pipeline need to create a new obj(filter) frequently with C++ new primitive, so if the filter has complex data member,it might take a huge time to do that?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - softarts
the TBB book shows us an example "packet processing pipeline" which implement with TBB pipeline.
if I understand correctly, the pipeline need to create a new obj(filter) frequently with C++ new primitive, so if the filter has complex data member,it might take a huge time to do that?
if I understand correctly, the pipeline need to create a new obj(filter) frequently with C++ new primitive, so if the filter has complex data member,it might take a huge time to do that?
Typically you'd build the pipeline dynamically as a setup operation and then run that pipeline with enough work to amortize the cost of the pipeline creation. If there are gaps in packet processing that lead to the termination of the pipeline (a null pointer passed along the filter chain), the pipeline should be restartable without having to recreate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the question is about filter objects specifically: the pipeline does not create, copy or delete them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Raf Schietekat
If the question is about filter objects specifically: the pipeline does not create, copy or delete them.
just check the code, should be the 'stage_task ' is created again,
but seems it is related with the task scheduler,not pipeline?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"just check the code, should be the 'stage_task ' is created again,
but seems it is related with the task scheduler,not pipeline?"
I presume that you meant to write that you "just checked the code", not that I should? In a pipeline you bring your own filter/stage objects, but TBB provides the tasks, and you have no say in what they look like or how they are operated. I would have chosen the name pipeline_task myself (a task stays with an item, not with a filter/stage), but that wouldn't mean that any pipeline objects are being created. :-) A pipeline could also be made to recycle its tasks, as I proposed a while ago in some experimental code, but I didn't measure its outcome.
but seems it is related with the task scheduler,not pipeline?"
I presume that you meant to write that you "just checked the code", not that I should? In a pipeline you bring your own filter/stage objects, but TBB provides the tasks, and you have no say in what they look like or how they are operated. I would have chosen the name pipeline_task myself (a task stays with an item, not with a filter/stage), but that wouldn't mean that any pipeline objects are being created. :-) A pipeline could also be made to recycle its tasks, as I proposed a while ago in some experimental code, but I didn't measure its outcome.
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