Return-Path: X-Original-To: apmail-qpid-commits-archive@www.apache.org Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 318621066D for ; Wed, 9 Oct 2013 01:40:55 +0000 (UTC) Received: (qmail 97173 invoked by uid 500); 9 Oct 2013 01:40:55 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 97112 invoked by uid 500); 9 Oct 2013 01:40:55 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 97105 invoked by uid 99); 9 Oct 2013 01:40:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 01:40:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Oct 2013 01:40:53 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id BBD3D23889BB; Wed, 9 Oct 2013 01:40:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1530480 - /qpid/trunk/qpid/extras/dispatch/src/server.c Date: Wed, 09 Oct 2013 01:40:33 -0000 To: commits@qpid.apache.org From: tross@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131009014033.BBD3D23889BB@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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