mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
OPTIM/MINOR: init/threads: only call protocol_enable_all() on first thread
There's no point in calling this on each and every thread since the first thread passing there will enable the listeners, and the next ones will simply scan all of them in turn to discover that they are already initialized. Let's only initilize them on the first thread. This could slightly speed up start up on very large configurations, eventhough most of the time is still spent in the main thread binding the sockets. A few measurements have constantly shown that this decreases the startup time by ~0.1s for 150k listeners. Starting all of them in parallel doesn't provide better results and can still expose some undesired races.
This commit is contained in:
parent
7109282577
commit
e4d7c9dd65
@ -2611,7 +2611,8 @@ static void *run_thread_poll_loop(void *data)
|
|||||||
thread_sync_release();
|
thread_sync_release();
|
||||||
thread_isolate();
|
thread_isolate();
|
||||||
|
|
||||||
protocol_enable_all();
|
if (tid == 0)
|
||||||
|
protocol_enable_all();
|
||||||
|
|
||||||
/* done initializing this thread, don't start before others are done */
|
/* done initializing this thread, don't start before others are done */
|
||||||
thread_sync_release();
|
thread_sync_release();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user