httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ian Holsman <i...@apache.org>
Subject Re: worker mpm -- fdqueue question
Date Wed, 07 Aug 2002 16:44:22 GMT
Brian Pane wrote:
> 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 might want to move the code from the mpm/worker into
the apr-util area too (which is what I was planning on doing, but if you 
beat me to it .. all the better ;-)

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




Mime
View raw message