commit 090a28b

default  ·  2023-02-09 07:09:55 +0000 UTC
parent 308a0e0
The number of threads can be forced from the config file.
1 files changed,  +6, -2
+6, -2
 1@@ -420,9 +420,13 @@ void httpd(void)
 2     sem_init(&job_sem, 0, 0);
 3     job_fifo = xs_list_new();
 4 
 5+    n_threads = xs_number_get(xs_dict_get(srv_config, "num_threads"));
 6+
 7 #ifdef _SC_NPROCESSORS_ONLN
 8-    /* get number of CPUs on the machine */
 9-    n_threads = sysconf(_SC_NPROCESSORS_ONLN);
10+    if (n_threads == 0) {
11+        /* get number of CPUs on the machine */
12+        n_threads = sysconf(_SC_NPROCESSORS_ONLN);
13+    }
14 #endif
15 
16     if (n_threads < 4)