]> git.ipfire.org Git - thirdparty/haproxy.git/commit
[OPTIM] displace tasks in the wait queue only if absolutely needed
authorWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2009 06:46:27 +0000 (07:46 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 8 Mar 2009 06:59:27 +0000 (07:59 +0100)
commit41365225276773d83e52e6f2151c9a075ba8dde2
tree8d1b8a0a1f165c53b2fb53c0397de5251eb2d9b5
parent4726f53794be62ecbf27c57a785cc14cb2b226e3
[OPTIM] displace tasks in the wait queue only if absolutely needed

We don't need to remove then add tasks in the wait queue every time we
update a timeout. We only need to do that when the new timeout is earlier
than previous one. We can rely on wake_expired_tasks() to perform the
proper checks and bounce the misplaced tasks in the rare case where this
happens. The motivation behind this is that we very rarely hit timeouts,
so we save a lot of CPU cycles by moving the tasks very rarely. This now
means we can also find tasks with expiration date set to eternity in the
queue, and that is not a problem.
src/task.c