Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When to use asynchronous operations in asio

When should I use asynchronous operations in boost::asio instead of synchronous operations in seperate threads?

like image 265
Daniel O Avatar asked Mar 01 '23 20:03

Daniel O


1 Answers

Does the Rationale section help?

Most programs interact with the outside world in some way, whether it be via a file, a network, a serial cable, or the console. Sometimes, as is the case with networking, individual I/O operations can take a long time to complete. This poses particular challenges to application development.

Boost.Asio provides the tools to manage these long running operations, without requiring programs to use concurrency models based on threads and explicit locking.

like image 127
dirkgently Avatar answered Mar 08 '23 02:03

dirkgently