I'd like to understand how web servers handle large number of simultaneous HTTP requests and responses. Please keep in mind I'm new to network programming.
Can the web server send multiple HTTP responses on port 80 at the same time? Or do the responses have to be "serialized"?
Does the web server receive requests in a serialized fashion? If so then inserting into a priority queue probably needs to be fast.
The short answer is that most web servers will process incoming requests in parallel by handling each request on a separate thread/process (by pulling thread from a threadpool or creating a new one). Usually, there is a cap on the number of requests that can be processed simultaneously (such as the maximum number of threads in the threadpool). Going beyond that cap means pending requests will wait in queue until another request finishes. If the server needs to do some asynchronous processing of the request, it may return the thread to the threadpool until it is ready to finish the request (such as with IHttpAsyncHandler in ASP.NET).
The server doesn't actually send back requests on port 80. The client will have its own port for that particular connection.