httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Greg Ames" <>
Subject Re: PR45605 and event MPM
Date Thu, 09 Oct 2008 20:53:11 GMT
On Tue, Oct 7, 2008 at 7:03 PM, Ruediger Pluem <> wrote:

> I am currently looking at PR45605 (
> and the analysis and the resulting patch in Comment 4 look good to me
> ( As worker
> and event MPM
> are very similar I had a look if and how this patch is applicable to the
> event MPM.
> I noticed that ap_queue_info_wait_for_idler is quite different in worker
> and event MPM.

I don't think the problem reported by PR45605 exists in the Event MPM.

I had to stare at ap_queue_info_wait_for_idler for a long time back when it
could be called by two separate threads.  The unserialized access to
queue_info->idlers followed by the unconditional decrement outside of the
mutex in that section of code made my head twitch when I thought about races
on SMP systems.

The two major improvements in Event's fdqueue are:

* doing the atomic decrement first before making a decision about waiting.
The decrement is visible to other threads immediately.
* using the negative value of idlers to distinguish between when threads
(just the listener today) are waiting for idle workers vs. when all workers
are busy but nobody else (the listener) is blocked.  That eliminates a
situation where the condition variable is signalled unnecessarily, which
happens in the PR scenario.


View raw message