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

Using TBB to improve performance of legacy application

sahasay
Beginner
247 Views
Hi All

I have a legacy routing application (posix thread/linux based) whose performance I intend to improve. This application receives messages from multiple clientsin a single port, processes themand routes them to multiple destinations.

To improve the performance in the shortest possible time, I am thinking of replacing the thread pool used for the processing to task based processing. So, the new architecture will be a posix thread receving message buffer from the single port and creating a new message processing task and executing it. Once the execution is complete, send the message to a thread pool (2 threads) to route it to multiple destinations.

I am thinking if I am approaching in the right directions and would like to hear from people here. From my previous posts I have found that I always receive insightful answers in this forum.

Thank youin advancefor your time.

Regards
Sayandeep
0 Kudos
2 Replies
RafSchietekat
Valued Contributor III
247 Views
Don't directly create and spawn tasks for incoming messages, because TBB is intentionally unfair to favour throughput instead, and your clients may frown on that. Feed the messages into a queue, then have the tasks read from the queue.
0 Kudos
softarts
Beginner
247 Views
Quoting - sahasay
Hi All

I have a legacy routing application (posix thread/linux based) whose performance I intend to improve. This application receives messages from multiple clientsin a single port, processes themand routes them to multiple destinations.

To improve the performance in the shortest possible time, I am thinking of replacing the thread pool used for the processing to task based processing. So, the new architecture will be a posix thread receving message buffer from the single port and creating a new message processing task and executing it. Once the execution is complete, send the message to a thread pool (2 threads) to route it to multiple destinations.

I am thinking if I am approaching in the right directions and would like to hear from people here. From my previous posts I have found that I always receive insightful answers in this forum.

Thank youin advancefor your time.

Regards
Sayandeep

I think you'd better use profile tool(i.e. vtune) to spot your bottleneck firstly, then continue to think about your solution.

you might consider TBB pipeline.but it also has some shortages,too light weight,not support loadshare(i.e.data can be sent to multi-destination).

you can find some examples on http://www.aeshen.com/sampleapps/index.html
0 Kudos
Reply