You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2013/10/09 03:40:33 UTC

svn commit: r1530480 - /qpid/trunk/qpid/extras/dispatch/src/server.c

Author: tross
Date: Wed Oct  9 01:40:33 2013
New Revision: 1530480

URL: http://svn.apache.org/r1530480
Log:
QPID-4963 - Removed the broken timer-holdoff feature which was causing the latencies.

Modified:
    qpid/trunk/qpid/extras/dispatch/src/server.c

Modified: qpid/trunk/qpid/extras/dispatch/src/server.c
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/extras/dispatch/src/server.c?rev=1530480&r1=1530479&r2=1530480&view=diff
==============================================================================
--- qpid/trunk/qpid/extras/dispatch/src/server.c (original)
+++ qpid/trunk/qpid/extras/dispatch/src/server.c Wed Oct  9 01:40:33 2013
@@ -329,7 +329,6 @@ static void *thread_run(void *arg)
     dx_connection_t *ctx;
     int              error;
     int              poll_result;
-    int              timer_holdoff = 0;
 
     if (!thread)
         return 0;
@@ -374,35 +373,20 @@ static void *thread_run(void *arg)
         //
         // Service pending timers.
         //
-        if (DEQ_SIZE(dx_server->pending_timers) > 0) {
-            dx_timer_list_t local_list;
-            dx_timer_t *timer = DEQ_HEAD(dx_server->pending_timers);
-
-            DEQ_INIT(local_list);
-            while (timer) {
-                DEQ_REMOVE_HEAD(dx_server->pending_timers);
-                DEQ_INSERT_TAIL(local_list, timer);
-                timer = DEQ_HEAD(dx_server->pending_timers);
-            }
+        dx_timer_t *timer = DEQ_HEAD(dx_server->pending_timers);
+        if (timer) {
+            DEQ_REMOVE_HEAD(dx_server->pending_timers);
 
             //
-            // Release the lock and invoke the connection handlers.
+            // Mark the timer as idle in case it reschedules itself.
             //
-            sys_mutex_unlock(dx_server->lock);
-
-            timer = DEQ_HEAD(local_list);
-            while (timer) {
-                DEQ_REMOVE_HEAD(local_list);
-
-                //
-                // Mark the timer as idle in case it reschedules itself.
-                //
-                dx_timer_idle_LH(timer);
-
-                timer->handler(timer->context);
-                timer = DEQ_HEAD(local_list);
-            }
+            dx_timer_idle_LH(timer);
 
+            //
+            // Release the lock and invoke the connection handler.
+            //
+            sys_mutex_unlock(dx_server->lock);
+            timer->handler(timer->context);
             pn_driver_wakeup(dx_server->driver);
             continue;
         }
@@ -466,13 +450,10 @@ static void *thread_run(void *arg)
                 //
                 // Visit the timer module.
                 //
-                if (poll_result == 0 || ++timer_holdoff == 100) {
-                    struct timespec tv;
-                    clock_gettime(CLOCK_REALTIME, &tv);
-                    long milliseconds = tv.tv_sec * 1000 + tv.tv_nsec / 1000000;
-                    dx_timer_visit_LH(milliseconds);
-                    timer_holdoff = 0;
-                }
+                struct timespec tv;
+                clock_gettime(CLOCK_REALTIME, &tv);
+                long milliseconds = tv.tv_sec * 1000 + tv.tv_nsec / 1000000;
+                dx_timer_visit_LH(milliseconds);
 
                 //
                 // Process listeners (incoming connections).



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org