httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Slemko <>
Subject Re: Comments on accept-mutex/single-listen patch ??
Date Wed, 29 Aug 2001 20:40:34 GMT
On Wed, 29 Aug 2001, Bill Stoddard wrote:

> If httpd is configured with multiple listeners, S_L_U_A is irrelevant because you have
> select() before calling accept(). And to the best of my knowledge, it is always bad to
> have multiple threads/processes block in select(), for all OS'.

Well... there may be performance tradeoffs, but the real reason why
we _MUST_ serialize in this case for robustness reasons is due to
a possible starvation condition.

Say you have two listening sockets, x and y.  If a request comes
in on socket x, then one or more processes will go from select()ing
on sockets {x, y} to accepting on x.  If there is only one connection,
then those other processes will be blocked until they get another request 
on x.  Meanwhile, there may be no processes left selecting on {x, y} which
means no requests on y will be serviced.  We solve that by making sure 
only one process will get past the select() stage for each connection
established, with the accept mutex.

View raw message