aboutsummaryrefslogtreecommitdiff
path: root/src/core/taskq.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/taskq.c')
-rw-r--r--src/core/taskq.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/taskq.c b/src/core/taskq.c
index ae66ec67..82a7456b 100644
--- a/src/core/taskq.c
+++ b/src/core/taskq.c
@@ -261,11 +261,14 @@ nni_task_fini(nni_task *task)
int
nni_taskq_sys_init(void)
{
- int rv;
+ int nthrs;
- // XXX: Make the "16" = NCPUs * 2
- rv = nni_taskq_init(&nni_taskq_systq, 16);
- return (rv);
+ nthrs = nni_plat_ncpu() * 2;
+ if (nthrs < 2) {
+ nthrs = 2;
+ }
+
+ return (nni_taskq_init(&nni_taskq_systq, nthrs));
}
void