Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

will(or can) pipeline do this ?

softarts
Beginner
312 Views
the pipeline like this: A->B->C->D

can we let programskip the C under some situations, that means the program will call D right after B ?



0 Kudos
3 Replies
Alexey-Kukanov
Employee
312 Views
Quoting - softarts
the pipeline like this: A->B->C->D

can we let programskip the C under some situations, that means the program will call D right after B ?




Thereare no special means for that in tbb::pipeline
To me, the easiest way seems to make the decision in the very beginning of C, just passing the data to D if no processing is required.
0 Kudos
softarts
Beginner
312 Views

Thereare no special means for that in tbb::pipeline
To me, the easiest way seems to make the decision in the very beginning of C, just passing the data to D if no processing is required.

think about packet process program,

PacketInput->analyse->calltrace->output

both PacketInput & output are serial executed,analyse and calltrace can be parallelly executed.
but packet from same ip/session should be passed to same calltrace filter
so how to let analyse filter choose the destinate filter,calltrace 1 or calltrace 2?

the developer should be responsible for these logic code?
0 Kudos
Alexey-Kukanov
Employee
312 Views
Quoting - softarts
think about packet process program,

PacketInput->analyse->calltrace->output

both PacketInput & output are serial executed,analyse and calltrace can be parallelly executed.
but packet from same ip/session should be passed to same calltrace filter
so how to let analyse filter choose the destinate filter,calltrace 1 or calltrace 2?

the developer should be responsible for these logic code?
Basically, yes, since only linear pipelines are supported for the moment.

The developer is responsible for making a decision of which filter to call, anyway. And the decision is done at runtime depending on a particular data item. It also allows the developer to choose desired way to organize the logic code, depending on the problem. Might bea simple switch statement insidethe filter is enough; or might be some hierarchy of processing classes can be established, and the filter would just call a virtual method on an object passed to it; etc.
0 Kudos
Reply