[MAJOR] replace the wait-queue linked list with an rbtree.
This patch from Sin Yu makes use of an rbtree for the wait queue,
which will solve the slowdown problem encountered when timeouts
are heterogenous in the configuration. The next step will be to
turn maintain_proxies() into a per-proxy task so that we won't
have to scan them all after each poll() loop.
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 5017d50..7b517d7 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2293,8 +2293,8 @@
return -1;
}
- t->next = t->prev = t->rqnext = NULL; /* task not in run queue yet */
- t->wq = LIST_HEAD(wait_queue[1]); /* already assigned to the eternity queue */
+ t->rqnext = NULL;
+ t->wq = NULL;
t->state = TASK_IDLE;
t->process = process_srv_queue;
t->context = newsrv;
@@ -2340,8 +2340,8 @@
return -1;
}
- t->next = t->prev = t->rqnext = NULL; /* task not in run queue yet */
- t->wq = LIST_HEAD(wait_queue[0]); /* but already has a wait queue assigned */
+ t->wq = NULL;
+ t->rqnext = NULL;
t->state = TASK_IDLE;
t->process = process_chk;
t->context = newsrv;