MAJOR: polling: Use active_appels_mask instead of applets_active_queue
applets_active_queue is the active queue size. It is a global variable. So it is
underoptimized because we may be lead to consider there are active applets for a
thread while in fact all active applets are assigned to the otherthreads. So, in
such cases, the polling loop will be evaluated many more times than necessary.
Instead, we now check if the thread id is set in the bitfield active_applets_mask.
This is specific to threads, no backport is needed.
diff --git a/src/haproxy.c b/src/haproxy.c
index 8f33e26..ba5a4b2 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -2307,7 +2307,7 @@
break;
/* expire immediately if events are pending */
- if (fd_cache_num || (active_tasks_mask & tid_bit) || signal_queue_len || applets_active_queue)
+ if (fd_cache_num || (active_tasks_mask & tid_bit) || signal_queue_len || (active_applets_mask & tid_bit))
next = now_ms;
/* The poller will ensure it returns around <next> */