2

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?

Hwan E
  • 566
  • 2
  • 13

1 Answers1

1

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.

sehe
  • 374,641
  • 47
  • 450
  • 633