diff options
| author | 2023-02-09 08:09:55 +0100 | |
|---|---|---|
| committer | 2023-02-09 08:09:55 +0100 | |
| commit | 090a28ba4e15c8d1996a872bed8df902bd6fb4c3 (patch) | |
| tree | b46c39865006e5147e0eb3c98559340920576dc4 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-090a28ba4e15c8d1996a872bed8df902bd6fb4c3.tar.gz snac2-090a28ba4e15c8d1996a872bed8df902bd6fb4c3.tar.xz snac2-090a28ba4e15c8d1996a872bed8df902bd6fb4c3.zip | |
The number of threads can be forced from the config file.
| -rw-r--r-- | httpd.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -420,9 +420,13 @@ void httpd(void) | |||
| 420 | sem_init(&job_sem, 0, 0); | 420 | sem_init(&job_sem, 0, 0); |
| 421 | job_fifo = xs_list_new(); | 421 | job_fifo = xs_list_new(); |
| 422 | 422 | ||
| 423 | n_threads = xs_number_get(xs_dict_get(srv_config, "num_threads")); | ||
| 424 | |||
| 423 | #ifdef _SC_NPROCESSORS_ONLN | 425 | #ifdef _SC_NPROCESSORS_ONLN |
| 424 | /* get number of CPUs on the machine */ | 426 | if (n_threads == 0) { |
| 425 | n_threads = sysconf(_SC_NPROCESSORS_ONLN); | 427 | /* get number of CPUs on the machine */ |
| 428 | n_threads = sysconf(_SC_NPROCESSORS_ONLN); | ||
| 429 | } | ||
| 426 | #endif | 430 | #endif |
| 427 | 431 | ||
| 428 | if (n_threads < 4) | 432 | if (n_threads < 4) |