Search code examples
c++asynchronousboostasio

I have a question about C ++ boost :: asio and std :: async


I know that both are designed asynchronously.

What I'm curious about is the function callback when creating a thread using the above two.

Is it possible for a single thread to write and read asynchronously?


Solution

  • Yes. In fact I have many examples of that on this site.

    I wrote one yesterday that starts out with true single-threading:

    Note that you can easily also do multi-client servers on a single thread:

    There must be many more, but these are the first hits I see.