Похожие чаты

In ASIO, does an async operation start a new thread

and returns on call to the callback or is it blocked and returns after the callback returns?

9 ответов

15 просмотров

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

Ihor
It doesn't start a thread and is not blocking. You...

How it is possible without thread? How async two different program works?

🖖- Автор вопроса
Ihor
It doesn't start a thread and is not blocking. You...

@JRandomGuy Thanks I really appreciate it

🖖- Автор вопроса
Cengizhan Pasaoglu
How it is possible without thread? How async two d...

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

🖖
Actually, it appears that if you run asio::io_serv...

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?

🖖- Автор вопроса
Cengizhan Pasaoglu
So, I am confused. I want it async without thread,...

No, you need to call asio::io_service::run() to get the result(s) and to pass it/them to the callback

Cengizhan Pasaoglu
So, I am confused. I want it async without thread,...

Async to me is just threads with an abstraction later on top. 🙂

Cengizhan Pasaoglu
So, I am confused. I want it async without thread,...

Me, writing a fiber implementation and a scheduler to solve that problem

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта