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

Asynchronous IO in TBB

Nishikawa__Mitsuru
812 Views

Dear all,

 

I am outputting some computed results per short time period. 

In order to achieve the benefits of concurrency, I am considering to introduce asynchronous IO.

 

Just output of data in memory to files is so simple that I wondering if executing task for outputting is met for my purpose.

On the other hand, I know there is some library for asynchronous IO (boost::asio etc).

Is TBB properly working with such a thread libraries? Or, should I close my methods in TBB?

 

I always thank for helpful comments of experts.

 

Kind regards

 

0 Kudos
1 Reply
Alexei_K_Intel
Employee
812 Views

Dear Mitsuru,

The general recommendation is to avoid IO operations on TBB worker threads (because it might reduce CPU utilization). So you can create a dedicated thread (or threads) and request them to perform IO operations when necessary. To organize communications between threads, you may want to consider tbb::concurrent_bounded_queue or tbb::flow::async_node.

Regards,
Alex

0 Kudos
Reply