and returns on call to the callback or is it blocked and returns after the callback returns?
It doesn't start a thread and is not blocking. You send an object that handles connection whenever OS creates it. Your program continues running. https://www.boost.org/doc/libs/1_74_0/doc/html/boost_asio/overview/core/basics.html
How it is possible without thread? How async two different program works?
@JRandomGuy Thanks I really appreciate it
Actually, it appears that if you run asio::io_service::run() in the main thread of execution, it blocks until all the operations are done You can decide to call asio::io_service::run() in a different thread
So, I am confused. I want it async without thread, it is not possible in this case because without thread it blocks until all operations done. But with new thread, async operation can be done. Did I understand right?
No, you need to call asio::io_service::run() to get the result(s) and to pass it/them to the callback
So which thread runs this callback?
Async to me is just threads with an abstraction later on top. 🙂
Me, writing a fiber implementation and a scheduler to solve that problem
Обсуждают сегодня