Re: Descriptors and Speed
well, i think the key, is that sockets operations are all asynchronous. polling a port doesn't typically happen in realtime, so the requests are run on a separate thread so that the host app can keep doing other things (like polling another port on another thread). this means that you could concievably have 300 threads running concurrently all using the same subsystems needed to access a port. since threads have trouble sharing resources, many objects must be duplicated for each. this takes time, and tracking.
additionally, the kernel has some protection against the rapid creation of large numbers of threads to prevent thread or fork bomb DOS attacks.
thats just a guess though, based on the network services i've created in past.
Things are rarely just crazy enough to work, but they're frequently just crazy enough to fail hilariously.
Bookmarks