]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: threads: make thread_release() not wait for other ones to complete
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Aug 2021 09:22:07 +0000 (11:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Aug 2021 12:49:36 +0000 (14:49 +0200)
commitf519cfaa63662cb704a0cc89136192b742812fce
tree699e765cc78b06e018a728a3cbcad0c556efb2ee
parent286363be0855d8d5d608cdaa1ebcc766ed174469
MINOR: threads: make thread_release() not wait for other ones to complete

The original intent of making thread_release() wait for other requesters to
proceed was more of a fairness trade, guaranteeing that a thread that was
granted an access to the CPU would be in turn giving back once its job is
done. But this is counter-productive as it forces such threads to spin
instead of going back to the poller, and it prevents us from implementing
multiple levels of guarantees, as a thread_release() call could spin
waiting for another requester to pass while that requester expects
stronger guarantees than the current thread may be able to offer.

Let's just remove that wait period and let the thread go back to the
poller, a-la "race to idle".

While in theory it could possibly slightly increase the perceived
latency of concurrent slow operations like "show fd" or "show sess",
it is not the case at all in tests, probably because the time needed
to reach the poller remains extremely low anyway.
src/thread.c