I'm currently trying to figure out what is the best way to minimize the number of threads that I use on the main TCP server in order to maximize performance.
As I read a lot recently with the new C # 5.0 asynchronous features, asynchronous does not necessarily mean multithreading. This can mean splitting into smaller pieces of objects with a final state, and then processed together with other operations by alternating. However, I do not see how this can be done on the network, since I basically "wait" for input (from the client).
Therefore, I would not use ReceiveAsync () for all of my sockets, it will just create and end threads continuously (assuming it creates threads).
Therefore, my question is more or less: what architecture can the main server take without one “thread” for each connection?
A side question for bonus cool points: why do you have a lot of threads, given that the number of threads exceeding the number of processor cores just makes the machine "fake" multithreading, like any other asynchronous method?
Lazlo
source share