]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MAJOR: threads: Start threads to experiment multithreading
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 29 Aug 2017 13:38:48 +0000 (15:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 12:58:29 +0000 (13:58 +0100)
commit1d17c10d8b82662be48bf9f7a4fc7df910a08d28
tree9269f8059f4d77c1588cc9ac77c67765f66f59d5
parent339fff8a18046aada616ac41437451b1f180534f
MAJOR: threads: Start threads to experiment multithreading

[WARNING] For now, HAProxy is not thread-safe, so from this commit, it will be
          broken for a while, when compiled with threads.

When nbthread parameter is greater than 1, HAProxy will create the corresponding
number of threads. If nbthread is set to 1, nothing should be done. So if there
are concurrency issues (and be sure there will be, unfortunatly), an obvious
workaround is to disable the multithreading...

Each created threads will run a polling loop. So, in a certain way, it is pretty
similar to the nbproc mode ("outside" the bugs and the lock
contention). Nevertheless, there are an init and a deinit steps for each thread
to deal with per-thread allocation.

Each thread has a tid (thread-id), numbered from 0 to (nbtread-1). It is used in
many place to do bitwise operations or to improve debugging information.
src/haproxy.c