httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Pane <bri...@apache.org>
Subject Re: worker mpm -- fdqueue question
Date Wed, 07 Aug 2002 16:40:38 GMT
Brian Pane wrote:

> Ian Holsman wrote:
>
>> am I reading this right??
>>
>> is the fdqueue a stack?
>
>
>
> Yes
>
>> wouldn't this lead to starvation on a busy system?
>
>
>
> It could, in the case where the stack becomes
> full.  But I think I may be able to fix this
> without having to change the stack to a queue.
> I'll check the code and respond with more details
> in a couple of minutes.


The design I was thinking of will solve the problem
partially, but not completely.

The idea was to have each worker thread check the stack
as it's about to become idle; if there's at least one
connection available in the stack, the worker should
process it rather than declaring itself idle.

There are two things wrong with this solution, though.
I can think of overload scenarios in which starvation
can still occur (e.g., if n-1 of the n worker threads
are busy handling long-lived connections).  And we'd
need something like ap_queue_pop_nonblocking() to check
for a new connection atomically at the end of each
request.  That would add another lock/unlock cycle on
the stack's mutex for every connection.

So it's probably better to switch to a queue instead
of a stack.  I'll implement a queue-based version
later today.

We may also want to revive the leader/follower code.

Brian




Mime
View raw message