mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-22 05:22:58 +00:00
d4604adeaa
Many changes have been made to do so. First, the fd_updt array, where all pending FDs for polling are stored, is now a thread-local array. Then 3 locks have been added to protect, respectively, the fdtab array, the fd_cache array and poll information. In addition, a lock for each entry in the fdtab array has been added to protect all accesses to a specific FD or its information. For pollers, according to the poller, the way to manage the concurrency is different. There is a poller loop on each thread. So the set of monitored FDs may need to be protected. epoll and kqueue are thread-safe per-se, so there few things to do to protect these pollers. This is not possible with select and poll, so there is no sharing between the threads. The poller on each thread is independant from others. Finally, per-thread init/deinit functions are used for each pollers and for FD part for manage thread-local ressources. Now, you must be carefull when a FD is created during the HAProxy startup. All update on the FD state must be made in the threads context and never before their creation. This is mandatory because fd_updt array is thread-local and initialized only for threads. Because there is no pollers for the main one, this array remains uninitialized in this context. For this reason, listeners are now enabled in run_thread_poll_loop function, just like the worker pipe. |
||
---|---|---|
.. | ||
accept4.h | ||
base64.h | ||
buffer.h | ||
cfgparse.h | ||
chunk.h | ||
compat.h | ||
compiler.h | ||
config.h | ||
debug.h | ||
defaults.h | ||
epoll.h | ||
errors.h | ||
hash.h | ||
hathreads.h | ||
http-hdr.h | ||
ist.h | ||
memory.h | ||
mini-clist.h | ||
namespace.h | ||
net_helper.h | ||
rbtree.h | ||
regex.h | ||
splice.h | ||
standard.h | ||
syscall.h | ||
template.h | ||
ticks.h | ||
time.h | ||
tools.h | ||
uri_auth.h | ||
version.h | ||
xref.h |