This http://aosabook.org/en/nginx.html says that "worker processes accept new requests from a shared ""listen" socket and execute a highly efficient run-loop inside each
I looked at hte code but did not understand how the socket is shared. Is it the case that the master process creates a listen queue, binds and then forks. In that case, how does the OS decide which worker process to hand over the incoming connection to? Is it round robin or random? I am assuming that different OS may have different policies
The question sounds exactly like "how does the OS decide which process will get to run".
http://en.wikipedia.org/wiki/Scheduling_%28computing%29#Operating_system_process_scheduler_implementations