]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: task: introduce work lists
authorWilly Tarreau <w@1wt.eu>
Fri, 12 Jul 2019 06:31:17 +0000 (08:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Jul 2019 07:07:48 +0000 (09:07 +0200)
commit64e6012eb92691bb9dd8d5cbfda0494d22c33b50
treeeca22fc1a6fcd539c444e7925cfb00f495c1f71f
parent4be7190c1024b82248a55456ea44b40c40d4f066
MINOR: task: introduce work lists

Sometimes we need to delegate some list processing to a function running
on another thread. In this case the list element will simply be queued
into a dedicated self-locked list and the task responsible for this list
will be woken up, calling the associated function which will run over the
list.

This is what work_list does. Such lists will be dedicated to a limited
type of work but will significantly ease such remote handling. A function
is provided to create these per-thread lists, their tasks and to properly
bind each task to a distinct thread, so that the caller only has to store
the resulting pointer to the start of the structure.

These structures should not be abused though as each head will consume
4 pointers per thread, hence 32 bytes per thread or 2 kB for 64 threads.
include/proto/task.h
include/types/task.h
src/task.c