mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
cpu: Set number of threads to number of cores
Cap this to 2 threads always because we need a low and high priority thread even with a single core. Fixes #40713 Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
@@ -129,7 +129,7 @@ cpu_init(void)
|
||||
always make sure we have at least two threads, so that there will be at
|
||||
least one thread of each kind.
|
||||
*/
|
||||
const int n_threads = get_num_cpus(get_options()) + 1;
|
||||
const int n_threads = MAX(get_num_cpus(get_options()), 2);
|
||||
threadpool = threadpool_new(n_threads,
|
||||
replyqueue,
|
||||
worker_state_new,
|
||||
|
||||
Reference in New Issue
Block a user