httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chr...@apache.org
Subject svn commit: r634050 - /httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c
Date Wed, 05 Mar 2008 22:08:26 GMT
Author: chrisd
Date: Wed Mar  5 14:08:25 2008
New Revision: 634050

URL: http://svn.apache.org/viewvc?rev=634050&view=rev
Log:
add comment from event MPM's fdqueue ap_pop_pool() regarding
ABA problem and avoidance because only caller is single listener thread

Modified:
    httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c

Modified: httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c?rev=634050&r1=634049&r2=634050&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c (original)
+++ httpd/httpd/branches/2.2.x/server/mpm/worker/fdqueue.c Wed Mar  5 14:08:25 2008
@@ -188,6 +188,14 @@
     apr_atomic_dec32(&(queue_info->idlers));
 
     /* Atomically pop a pool from the recycled list */
+
+    /* This function is safe only as long as it is single threaded because
+     * it reaches into the queue and accesses "next" which can change.
+     * We are OK today because it is only called from the listener thread.
+     * cas-based pushes do not have the same limitation - any number can
+     * happen concurrently with a single cas-based pop.
+     */
+
     for (;;) {
         struct recycled_pool *first_pool = queue_info->recycled_pools;
         if (first_pool == NULL) {



Mime
View raw message