]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: threads/task: handle multithread on task scheduler
authorEmeric Brun <ebrun@haproxy.com>
Wed, 27 Sep 2017 12:59:38 +0000 (14:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 12:58:30 +0000 (13:58 +0100)
commitc60def8368f73e578685c4f02df7d6dbe63c85d3
treeeec6ddf9db14d8fb8e53a45752e3a93f4f795cb1
parent209d02a257d795c3b682c858277e7cbc738aefdf
MAJOR: threads/task: handle multithread on task scheduler

2 global locks have been added to protect, respectively, the run queue and the
wait queue. And a process mask has been added on each task. Like for FDs, this
mask is used to know which threads are allowed to process a task.

For many tasks, all threads are granted. And this must be your first intension
when you create a new task, else you have a good reason to make a task sticky on
some threads. This is then the responsibility to the process callback to lock
what have to be locked in the task context.

Nevertheless, all tasks linked to a session must be sticky on the thread
creating the session. It is important that I/O handlers processing session FDs
and these tasks run on the same thread to avoid conflicts.
15 files changed:
include/common/hathreads.h
include/proto/task.h
include/types/task.h
src/cfgparse.c
src/checks.c
src/dns.c
src/flt_spoe.c
src/haproxy.c
src/hlua.c
src/peers.c
src/proxy.c
src/session.c
src/stick_table.c
src/stream.c
src/task.c