Category "c++-coroutine"

Boost.Asio async_read a string from a socket

I'm trying to write a function async_read_string_n to asynchronously read a string of exactly n bytes from a socket with Boost.Asio 1.78 (and GCC 11.2). This is

Coroutines are not distributed over asio::thread_pool threads

I wanted to try out to c++20 coroutines together with asio. In a simple test three are coroutines which would be executed on a asio::thread_pool with 4 threads.

Two ways of calling coroutines nestedly?

Imagine you have those coroutines awaitable<void> a() { ... } awaitable<void> b() { co_await a(); } awaitable<void> c() { co_await