httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <>
Subject systems without accept_mutex, bug?
Date Sat, 19 Apr 1997 04:03:43 GMT
I've been peering at child_main.  Suppose you're on a system which doesn't
use accept_mutex().  Suppose that your configuration has multiple Listens
so that you've got multiple sockets to select() on.  Now, all the idle
children end up in select() at the same time.  It is possible that
connections will be waiting on multiple sockets.  So multiple children
leave select() with multiple sockets listed in main_fds.

All those children wander down to the accept().  Notice that they're all
going to run accept() on the *same socket* (well assuming that main_fds is
the same).  Our listening sockets are blocking, so all but one of them is
about to block in accept().

That doesn't seem like a good situation to be in.  It results in
starvation of the other sockets.

Why *doesn't* this happen?  I'm assuming it doesn't, because otherwise
architectures without USE_FCNTL_SERIALIZED_ACCEPT or
USE_FLOCK_SERIALIZED_ACCEPT would have real problems handling Listen

Maybe it is happening, but not as bad as it could be.  For example, it
could just be that a few children get blocked like this, or that the
sockets are busy enough to not really notice it... 


View raw message