Recently, I learned about the existence of async / await. I want to ask for advice if I replace the creation of a new thread for waiting for connections and a new stream for each new user on async / await, can my server, without stopping the main program flow, receive new users and again through async / await create classes for them and execute code for each in a separate thread

  • one
    If you do it right, then it will be so. Separate threads will be taken from the pool when and if necessary. - rdorn 4:18 pm
  • @rdorn here for this example guided gist.github.com/jamesmanning/2622054 - nagiyafeb
  • A good example as a basis, just try to figure out what is there and why, then you can expand it to fit all your needs. Well, here about async/await already a lot of things have been written with details and nuances, for example here . - rdorn 4:26 pm
  • 2
    The main thing you need to understand is that asynchrony! = Multithreading. There are a lot of answers on the site explaining the difference - tym32167
  • one
    Possible duplicate question: Need async / await or not needed? - Grundy

0