they are. This is needed since it can happen that we are signaled by a
worker thread that went idle but received a context switch before it could
tell us. If it does signal us later once it is on CPU again there might be
no idle worker left. See
https://issues.apache.org/bugzilla/show_bug.cgi?id=45605#c4
PR: 45605
Submitted by: Denis Ustimenko <denusk gmail.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@702867 13f79535-47bb-0310-9956-ffa450edef68
- Fix the same race condition in event MPM.
- Slightly optimize code in worker MPM by removing the need for an additional
dereference operation.
- Do some word smithing on the CHANGES entry.
PR: 44402
Submitted by: Basant Kumar Kukreja <basant.kukreja sun.com>
Reviewed by: rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630348 13f79535-47bb-0310-9956-ffa450edef68
PR 38699, 39518, 42005, 42006, 42007, 42008, 42009
The patches are all his, and are sufficiently trivial to review
at a glance.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557837 13f79535-47bb-0310-9956-ffa450edef68
(the old code assumed that apr_atomic_t and apr_uint32_t were interchangeable).
Also, add more detailed comments on how one of the synchronization
functions works.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101340 13f79535-47bb-0310-9956-ffa450edef68
If the worker thread synchronization is working properly, it's not
necessary to set these fields to NULL after removing an element from
the queue, and it's IMO more important to have a shorter code path
leading up to the mutex_unlock. I left in support for NULLing the
fields when debugging, though.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94850 13f79535-47bb-0310-9956-ffa450edef68
logic from the file descriptor queue, now that we can rely on the
idle worker reference count to keep the listener from trying to
push connections into a full queue
Reviewed by: Aaron Bannert (concept)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94845 13f79535-47bb-0310-9956-ffa450edef68
The advantage of doing this is that it enables us to guarantee that the
number of ptrans pools in existence at once is no greater than the
number of worker threads, and that we'll never have to delete ptrans
pools.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94830 13f79535-47bb-0310-9956-ffa450edef68
the listener thread from accept()ing more connections than there are
available workers. This prevents long-running requests from starving
connections that have been accepted but not yet processed.
The queue_info is a simple counter, mutex, and condition variable. Only
the listener thread blocks on the condition, and only when there are no
idle workers. In the fast path there is a mutex lock, integer decrement,
and and unlock (among a few conditionals). The worker threads each notify
the queue_info when they are about to block on the normal worker_queue
waiting for some connection to process, which wakes up any sleeping
listener thread to go perform another accept() in parallel.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94824 13f79535-47bb-0310-9956-ffa450edef68
elements in the queue represent accept()ed connections, we want them
to be processed in the order that they were received. (I erroneously
converted it to a LIFO quite awhile ago in the hopes that it would
improve cache efficiency.)
Remember to perform a make clean in the worker directory after this patch,
since this patch changes the size of the fd_queue_t object (which is
allocated in worker.c).
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94813 13f79535-47bb-0310-9956-ffa450edef68
threads could exit even though there were connections waiting in the
queue.
Now, for a graceful restart the worker threads won't exit until they
are told that the queue has been drained and no more connections will
ever be added.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94106 13f79535-47bb-0310-9956-ffa450edef68
per-transaction pools instead of destroying them. Based on
Ian's benchmark testing, this reduces CPU utilization by
about 1% on Solaris.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93386 13f79535-47bb-0310-9956-ffa450edef68
- Mutexes and Condition Variables from APR are now used instead of
direct (non-portable) calls to pthread.
Still need to fully APRize these routines, particularly the return
values. In many cases a failed lock or cond var call will simply return
FD_QUEUE_FAILURE. This should obviously instead return the appropriate
APR error code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91531 13f79535-47bb-0310-9956-ffa450edef68
suggestions to getting rid of redundant variables, as well as
converting the simple ap_queue_full/ap_queue_empty tests into macros.
This also reinstates the "not_full" condition, which turned out to
be useful afterall in cases where we wanted to prevent the listener
thread from accepting further connections until the worker queue has
room for more.
Submitted by: [Aaron Bannert <aaron@clove.org>]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91223 13f79535-47bb-0310-9956-ffa450edef68
pools. This incurs less overhead than shuffling the pools
around so that they can be re-used. Remove one of the
queue's condition variables. We just redefined the API to
state that you can't try to add more stuff than you allocated
segments for.
Submitted by: Aaron Bannert <aaron@clove.org>
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91075 13f79535-47bb-0310-9956-ffa450edef68
up with anything better. This is a multiple-worker/single listener MPM.
This MPM is definately not complete, but it is a first step in the
right direction.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89781 13f79535-47bb-0310-9956-ffa450edef68