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

TBB::pipeline : Unordered Execution of Serial Stages

Intel_C_3
Beginner
437 Views
Is it possible to have the pipeline process jobs in serial stages in FIFO order
rather than in the order they were created in the input filter? I have a pipeline
where I need to enforce serial access to a resource but not ordered access.
0 Kudos
4 Replies
Alexey-Kukanov
Employee
437 Views

This is not possible yet, but we consider adding such functionality.

Can you describe your casein some more details? In particular, do you think you would get better performance with serial but unordered filter, and why.

Thanks.

0 Kudos
Intel_C_3
Beginner
437 Views
My interest in using an unordered filter is in minimizing the latency between stages of the pipeline. I have a simple pipeline with three filters. The first and last are serial to ensure safe access to some global data structures. These stages take very little time relative to the middle filter. The middle filter is a parallel stage where all of the "real" work happens. The processing of tokens in the middle stage has a variable runtime for each token. I would like to ensure that if several short jobs finish the second stage that are not stuck waiting on a long job that started earlier to finish. It is important in my case to have the final stage record the results of the second stage jobs with low latency from the time of completion since the pipeline may be interrupted at any time. I hope this gives a since of why an unordered serial stage would be useful.
0 Kudos
Alexey-Kukanov
Employee
437 Views

This definitely sounds as a good argument for unordered serial stage.

At the moment, I only can promise that we will consider it, and I will let you know the decision. I think chances are good that this functionality is voted for a future release.

And since TBB is open-source, you always have the option to implement it on your own and contribute to the project :)

0 Kudos
Alexey-Kukanov
Employee
437 Views
For those interested in unordered serial stages in tbb::pipeline, this functionality has been implemented and is available in the recent development updates.
0 Kudos
Reply