diff options
| author | Ted Ross <tross@apache.org> | 2013-10-09 01:40:33 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2013-10-09 01:40:33 +0000 |
| commit | 677968e6e59d748fc1eea30bf7000982bba8ae10 (patch) | |
| tree | 7b7e8692a1b663a3bab1faee76bb05a83d6a2a64 | |
| parent | 93a622976ec8949783eedd7de1b55bb3b70acb51 (diff) | |
| download | qpid-python-677968e6e59d748fc1eea30bf7000982bba8ae10.tar.gz | |
QPID-4963 - Removed the broken timer-holdoff feature which was causing the latencies.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1530480 13f79535-47bb-0310-9956-ffa450edef68
| -rw-r--r-- | qpid/extras/dispatch/src/server.c | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/qpid/extras/dispatch/src/server.c b/qpid/extras/dispatch/src/server.c index 7424a45871..e81672dea9 100644 --- a/qpid/extras/dispatch/src/server.c +++ b/qpid/extras/dispatch/src/server.c @@ -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). |
