mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 06:25:04 +00:00
The number of threads can be forced from the config file.
This commit is contained in:
parent
308a0e0f64
commit
090a28ba4e
1 changed files with 6 additions and 2 deletions
8
httpd.c
8
httpd.c
|
@ -420,9 +420,13 @@ void httpd(void)
|
|||
sem_init(&job_sem, 0, 0);
|
||||
job_fifo = xs_list_new();
|
||||
|
||||
n_threads = xs_number_get(xs_dict_get(srv_config, "num_threads"));
|
||||
|
||||
#ifdef _SC_NPROCESSORS_ONLN
|
||||
/* get number of CPUs on the machine */
|
||||
n_threads = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
if (n_threads == 0) {
|
||||
/* get number of CPUs on the machine */
|
||||
n_threads = sysconf(_SC_NPROCESSORS_ONLN);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (n_threads < 4)
|
||||
|
|
Loading…
Reference in a new issue