httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chr...@apache.org
Subject svn commit: r633612 - /httpd/httpd/trunk/server/mpm/worker/fdqueue.c
Date Tue, 04 Mar 2008 20:03:55 GMT
Author: chrisd
Date: Tue Mar  4 12:03:51 2008
New Revision: 633612

URL: http://svn.apache.org/viewvc?rev=633612&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/trunk/server/mpm/worker/fdqueue.c

Modified: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/fdqueue.c?rev=633612&r1=633611&r2=633612&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/fdqueue.c Tue Mar  4 12:03:51 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