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.
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.