/[Apache-SVN]/httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c
ViewVC logotype

Log of /httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (annotate)
Sticky Revision:

Revision 705872 - (view) (annotate) - [select for diffs]
Modified Sat Oct 18 10:19:32 2008 UTC (13 months, 1 week ago) by rpluem
File length: 12930 byte(s)
Diff to previous 634050 (colored)
Merge r702867 from trunk:

* Recheck again if idle workers are still available when we are signaled that
  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, jim, gregames

Revision 634050 - (view) (annotate) - [select for diffs]
Modified Wed Mar 5 22:08:25 2008 UTC (20 months, 3 weeks ago) by chrisd
File length: 12456 byte(s)
Diff to previous 631362 (colored)
add comment from event MPM's fdqueue ap_pop_pool() regarding
ABA problem and avoidance because only caller is single listener thread

Revision 631362 - (view) (annotate) - [select for diffs]
Modified Tue Feb 26 19:51:29 2008 UTC (21 months ago) by jim
File length: 12096 byte(s)
Diff to previous 559449 (colored)
Merge r630335, r630348, r630350 from trunk:

Worker MPM: fix race condition
PR44402: reported and fixed by Basant Kumar Kukreja


* Second part of fix for PR 44402:

  - 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


* Add hint to PR in comment. No functional change.

Reviewed by: jim

Revision 559449 - (view) (annotate) - [select for diffs]
Modified Wed Jul 25 13:13:49 2007 UTC (2 years, 4 months ago) by niq
File length: 11865 byte(s)
Diff to previous 421103 (colored)
Backport trivial cleanups

Revision 421103 - (view) (annotate) - [select for diffs]
Modified Wed Jul 12 03:38:44 2006 UTC (3 years, 4 months ago) by fielding
File length: 11896 byte(s)
Diff to previous 396056 (colored)
update license header text

Revision 396056 - (view) (annotate) - [select for diffs]
Modified Sat Apr 22 01:53:06 2006 UTC (3 years, 7 months ago) by pquerna
File length: 11749 byte(s)
Diff to previous 395231 (colored)
Revert r395231 from the 2.2.x branch.  This gets us back to the old place with regard to the copyright statements.

Revision 395231 - (view) (annotate) - [select for diffs]
Modified Wed Apr 19 12:33:16 2006 UTC (3 years, 7 months ago) by colm
File length: 11749 byte(s)
Diff to previous 332309 (colored)
Update the last year of copyright for the 2.2.x branch

Revision 332309 - (view) (annotate) - [select for diffs]
Modified Thu Nov 10 15:20:05 2005 UTC (4 years ago) by jim
File length: 11749 byte(s)
Diff to previous 234103 (colored)
No functional change: remove trailing whitespace. This also means
that "blank" lines, which had consisted of just spaces
and/or tabs are now truly blank lines

Revision 234103 - (view) (annotate) - [select for diffs]
Modified Sat Aug 20 18:21:45 2005 UTC (4 years, 3 months ago) by pquerna
File length: 11757 byte(s)
Diff to previous 151408 (colored)
Recreate 2.2.x branch from trunk.

Revision 151408 - (view) (annotate) - [select for diffs]
Modified Fri Feb 4 20:28:49 2005 UTC (4 years, 9 months ago) by jerenkrantz
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11757 byte(s)
Diff to previous 111385 (colored)
Update copyright year to 2005 and standardize on current copyright owner line.

Revision 111385 - (view) (annotate) - [select for diffs]
Modified Thu Dec 9 14:11:29 2004 UTC (4 years, 11 months ago) by gregames
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11721 byte(s)
Diff to previous 106103 (colored)
ap_queue_push:  update comment to reflect reality

pointed out by: Ron Park (ronp cnet.com)

Revision 106103 - (view) (annotate) - [select for diffs]
Modified Sun Nov 21 18:50:36 2004 UTC (5 years ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11764 byte(s)
Diff to previous 102619 (colored)
general property cleanup

Revision 102619 - (view) (annotate) - [select for diffs]
Modified Mon Feb 9 20:40:53 2004 UTC (5 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11764 byte(s)
Diff to previous 102587 (colored)
fix name of The Apache Software Foundation

Revision 102587 - (view) (annotate) - [select for diffs]
Modified Sun Feb 8 13:52:12 2004 UTC (5 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11760 byte(s)
Diff to previous 102525 (colored)
fix copyright dates according to the first checkin

Revision 102525 - (view) (annotate) - [select for diffs]
Modified Fri Feb 6 22:58:42 2004 UTC (5 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11760 byte(s)
Diff to previous 102135 (colored)
apply Apache License, Version 2.0

Revision 102135 - (view) (annotate) - [select for diffs]
Modified Thu Jan 1 13:26:26 2004 UTC (5 years, 10 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 13979 byte(s)
Diff to previous 101340 (colored)
update license to 2004.

Revision 101340 - (view) (annotate) - [select for diffs]
Modified Mon Sep 29 03:58:41 2003 UTC (6 years, 1 month ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 13979 byte(s)
Diff to previous 101236 (colored)
Switch to the new 32-bit APR atomic API for better portability
(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.

Revision 101236 - (view) (annotate) - [select for diffs]
Modified Sat Sep 13 03:45:50 2003 UTC (6 years, 2 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 13564 byte(s)
Diff to previous 100542 (colored)
Add casts to apr_atomic_casptr arguments to avoid compiler warnings

Revision 100542 - (view) (annotate) - [select for diffs]
Modified Thu Jul 10 20:29:25 2003 UTC (6 years, 4 months ago) by jorton
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 13513 byte(s)
Diff to previous 98573 (colored)
Minor cleanups:

* fdqueue.c (ap_queue_info_term, ap_queue_interrupt_all):
Remove redundant conditionals.

Revision 98573 - (view) (annotate) - [select for diffs]
Modified Mon Feb 3 17:53:28 2003 UTC (6 years, 9 months ago) by nd
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 13659 byte(s)
Diff to previous 98272 (colored)
finished that boring job:
update license to 2003.

Happy New Year! ;-))

Revision 98272 - (view) (annotate) - [select for diffs]
Modified Wed Jan 15 13:43:58 2003 UTC (6 years, 10 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 13659 byte(s)
Diff to previous 98159 (colored)
fix the type of the idlers field to match what apr_atomic_cas() expects

this fixes the compile when using the native compiler for AIX (and likely
other non-gcc compilers)

Revision 98159 - (view) (annotate) - [select for diffs]
Modified Fri Jan 3 18:35:08 2003 UTC (6 years, 10 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 13650 byte(s)
Diff to previous 96294 (colored)
Replace most of the mutex locking in the worker MPM's "queue info"
object with atomic compare-and-swap loops.

Revision 96294 - (view) (annotate) - [select for diffs]
Modified Fri Aug 2 17:37:52 2002 UTC (7 years, 3 months ago) by ianh
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11585 byte(s)
Diff to previous 94850 (colored)
typo

Revision 94850 - (view) (annotate) - [select for diffs]
Modified Mon Apr 29 01:57:39 2002 UTC (7 years, 7 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11586 byte(s)
Diff to previous 94845 (colored)
Removed some code from the mutex-protected block in ap_queue_pop().
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.

Revision 94845 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 23:12:35 2002 UTC (7 years, 7 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 11548 byte(s)
Diff to previous 94830 (colored)
Removed the "not_full" condition variable and associated conditional
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)

Revision 94830 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 05:28:18 2002 UTC (7 years, 7 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 12232 byte(s)
Diff to previous 94829 (colored)
Moved the recycled pool list from the queue to the queue_info structure.
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.

Revision 94829 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 04:48:43 2002 UTC (7 years, 7 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 12219 byte(s)
Diff to previous 94828 (colored)
Added a missing pool deletion case and simplified the conditionals
for the error-case return (thanks to Justin for suggesting the
latter)

Revision 94828 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 03:32:10 2002 UTC (7 years, 7 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 12299 byte(s)
Diff to previous 94827 (colored)
Move a potentially expensive pool cleanup operation outside
the mutex-protected critical path of ap_queue_pop()

Revision 94827 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 03:20:06 2002 UTC (7 years, 7 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 12090 byte(s)
Diff to previous 94824 (colored)
Preserve the original error, or if the unlock fails then use that
error instead.

Obtained from:  Justin Erenkrantz
Submitted by:	Aaron Bannert

Revision 94824 - (view) (annotate) - [select for diffs]
Modified Sun Apr 28 01:45:00 2002 UTC (7 years, 7 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 12057 byte(s)
Diff to previous 94813 (colored)
Add a "queue_info" structure to the worker MPM. This is used to prevent
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.

Revision 94813 - (view) (annotate) - [select for diffs]
Modified Fri Apr 26 17:13:51 2002 UTC (7 years, 7 months ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 9087 byte(s)
Diff to previous 94106 (colored)
Convert the worker MPM's fdqueue from a LIFO back into a FIFO. Since
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).

Revision 94106 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 19:12:54 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 8910 byte(s)
Diff to previous 94088 (colored)
Don't drop connections during graceful restart.  Previously, worker
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.

Revision 94088 - (view) (annotate) - [select for diffs]
Modified Thu Mar 21 15:27:31 2002 UTC (7 years, 8 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 8108 byte(s)
Diff to previous 93918 (colored)
fix a comment

Revision 93918 - (view) (annotate) - [select for diffs]
Modified Wed Mar 13 20:48:07 2002 UTC (7 years, 8 months ago) by fielding
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 8109 byte(s)
Diff to previous 93530 (colored)
Update our copyright for this year.

Revision 93530 - (view) (annotate) - [select for diffs]
Modified Thu Feb 21 14:22:05 2002 UTC (7 years, 9 months ago) by trawick
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 8109 byte(s)
Diff to previous 93386 (colored)
Convert the ap_queue_foo routines to return apr_status_t as appropriate.

Revision 93386 - (view) (annotate) - [select for diffs]
Modified Wed Feb 13 04:49:55 2002 UTC (7 years, 9 months ago) by brianp
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 8102 byte(s)
Diff to previous 91531 (colored)
Performance optimization: updated the worker MPM to recycle
per-transaction pools instead of destroying them.  Based on
Ian's benchmark testing, this reduces CPU utilization by
about 1% on Solaris.

Revision 91531 - (view) (annotate) - [select for diffs]
Modified Wed Oct 17 16:29:37 2001 UTC (8 years, 1 month ago) by aaron
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 7391 byte(s)
Diff to previous 91223 (colored)
Fully convert worker's fdqueue to the new APR lock API:
- 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.

Revision 91223 - (view) (annotate) - [select for diffs]
Modified Mon Oct 1 19:37:20 2001 UTC (8 years, 1 month ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 7154 byte(s)
Diff to previous 91077 (colored)
clean up the fdqueue a bit more, by implementing Greg's
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>]

Revision 91077 - (view) (annotate) - [select for diffs]
Modified Tue Sep 18 23:09:12 2001 UTC (8 years, 2 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 7062 byte(s)
Diff to previous 91075 (colored)
Turn the worker MPM's queue into a LIFO.  This may
improve cache-hit performance under some conditions.

Submitted by:   Aaron Bannert <aaron@clove.org>

Revision 91075 - (view) (annotate) - [select for diffs]
Modified Tue Sep 18 21:14:18 2001 UTC (8 years, 2 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 7231 byte(s)
Diff to previous 90749 (colored)
Cleanup the worker MPM.  We no longer re-use transaction
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>

Revision 90749 - (view) (annotate) - [select for diffs]
Modified Mon Aug 27 23:50:12 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 7373 byte(s)
Diff to previous 90635 (colored)
Remove an obsolete function from fdqueue.  The worker MPM now uses the
fdqueue functions in a different way.
Submitted by:	Aaron Bannert <aaron@clove.org>

Revision 90635 - (view) (annotate) - [select for diffs]
Modified Fri Aug 24 16:49:39 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 7831 byte(s)
Diff to previous 89930 (colored)
Make the worker MPM shutdown and restart cleanly.  This also
cleans up some race conditions, and gets the worker using
pools more cleanly.

Submitted by:	[Aaron Bannert <aaron@clove.org>]

Revision 89930 - (view) (annotate) - [select for diffs]
Modified Sun Aug 5 18:41:38 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 6116 byte(s)
Diff to previous 89827 (colored)
Get the worker MPM working again.  This should fix the serialization
problems, and it makes up initialize the queue only once.

Revision 89827 - (view) (annotate) - [select for diffs]
Modified Tue Jul 31 15:35:28 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 6262 byte(s)
Diff to previous 89781 (colored)
It helps if we broadcast to the workers that we are trying to shutdown.

Revision 89781 - (view) (annotate) - [select for diffs]
Added Mon Jul 30 05:02:53 2001 UTC (8 years, 3 months ago) by rbb
Original Path: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
File length: 6054 byte(s)
Add the worker MPM.  The name is probably horrible, but I couldn't come
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.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

apache@apache.org
ViewVC Help
Powered by ViewVC 1.1.2