httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bojan Smojver <>
Subject Re: worker MPM: close_worker_sockets race?
Date Thu, 22 Oct 2009 20:58:13 GMT
On Thu, 2009-10-22 at 07:54 -0400, Jeff Trawick wrote:
> I have long suspected that there is a race here, and that this code
> should do shutdown for read and write rather than close in order to
> avoid any possible funny business with descriptors.

Phew! So I'm not totally insane after all :-)

Note that the attached _still_ has a race. If worker_sockets[i] is set
to NULL by the worker (i.e. processing just finished) before we get that
csd, we are going to segfault.

Having ap_threads_per_child mutexes (i.e. one for each
worker_sockets[i]) would probably be an overkill, so if we had just one
for all worker_sockets, that would be an improvement, although it would
slow things down a little bit.


View raw message