Q:

Asynchronous vs synchronoous socket

I have a situation that there will be 500 concurrent connection to server. In term of response time which method is faster? (asynchronous or synchronous) And what are the reasons behind?
I know asynchronous socket is like a list of connection, then it will ask each of the connection, do you have anything to send or receive. If the list is very long, then response time may take longer as well. Is this correct?

A:

If you use synchronous sockets, then 500 connections will requires 500 threads. Bad idea. The scheduling cost of that many threads will dwarf the overhead of keeping an eye on 500 asynchronous sockets.
BTW, you don't cycle over each socket, asking it if it's ready to transmit. You use async APIs such as select(), or I/O completion ports.

