MEDIUM: queue: unlock as soon as possible
authorWilly Tarreau <w@1wt.eu>
Fri, 18 Jun 2021 18:12:11 +0000 (20:12 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Jun 2021 16:57:18 +0000 (18:57 +0200)
commit5b3927531145384bad8d2b46ca21f017afde81c7
tree30e5c3517af26dbf2e51914159db851d724e1a72
parent9a6d0ddbd6788a05c6730bf0e9e8550d7c5b11aa
MEDIUM: queue: unlock as soon as possible

There's no point keeping the server's queue lock after seeing that the
server's queue is empty, just like there's no need to keep the proxy's
lock when its queue is empty. This patch checks for emptiness and
releases these locks as soon as possible.

With this the performance increased from 524k to 530k on 16 threads
with round-robin.
src/queue.c