You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ian Holsman <ia...@apache.org> on 2002/08/10 22:52:47 UTC

is apr_thread_cond_signal expensive ?

I'm just looking through the fdqueue code again, and I noticed that we 
are signaling the !empty condition
on every push, regardless if we were empty or not, is there a good 
reason to do this, instead of checking if
we are empty and then doing the signal?
--Ian


Re: is apr_thread_cond_signal expensive ?

Posted by Brian Pane <br...@apache.org>.
Ian Holsman wrote:

> I'm just looking through the fdqueue code again, and I noticed that we 
> are signaling the !empty condition
> on every push, regardless if we were empty or not, is there a good 
> reason to do this, instead of checking if
> we are empty and then doing the signal? 


It should be safe to skip the signal if the queue wasn't
previously empty.  I don't expect that it will help a lot,
though: the queue_info synchronization guarantees that
there's an idle worker available before the listener can
push a new connection onto the queue, so it ought to be
rare for the queue to be non-empty at the start of
ap_queue_push().

Brian