httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bp...@pacbell.net>
Subject Re: cvs commit: httpd-2.0 STATUS
Date Fri, 26 Apr 2002 16:39:53 GMT
Bill Stoddard wrote:

>>  +    * The worker MPM should not accept more connections than it
>>  +      currently has available workers. Instead, the listener thread
>>  +      should block on a condition of the fdqueue such that it waits
>>  +      until there are at least one idle worker before continuing
>>  +      into the accept-loop.
>>
>
>Here is an alternate idea... keep track of the number of available workers with a counter.
>If the accept loop detects that the number of available workers has dropped to 0, the
>accept thread simply yields it's quanta. Very simple and no overhead associated with a
>condition variable. Something like this:
>
>if (!avail_workers) {
>   yield(); /* or what ever the Unix call is. I know there must be one */
>   continue;
>}
>else {
>   accept();
>}
>

I actually prototyped something like this a few weeks ago (before
giving up on worker improvements in favor of the various experimental
MPMs).  The idea definitely works, and the logic for maintaining the
idle worker count is simple enough: increment the count before a
worker blocks on the condition var, and decrement it afterward.

--Brian




Mime
View raw message