It enables programmers to write cross-platform networking code.
However, that would require the main program to wait until all data bytes has been sent and either an acknowledgement or an error code is available. With the synchronous way, the return value of a function would be evaluated. In a typical asynchronous network application, if data is sent over the Internet, it is important to know whether it has been sent successfully or not.
Each thread will consume at least one memory page of stack, plus some unknown amount of memory for other data structures related to that thread’s state.īoost.Asio (Asynchronous Input/ Output) provides rich set of APIs to handle long running jobs, without spawning multiple threads and providing synchronization mechanisms between them.