cap number of threads for --num-threads=0 (#3547)
* cap number of threads for --num-threads=0 * cap at 16 threads instead
This commit is contained in:
parent
57fc9d5433
commit
d63b836f61
|
@ -352,7 +352,7 @@ proc init*(T: type BeaconNode,
|
||||||
fatal "The number of threads --numThreads cannot be negative."
|
fatal "The number of threads --numThreads cannot be negative."
|
||||||
quit 1
|
quit 1
|
||||||
elif config.numThreads == 0:
|
elif config.numThreads == 0:
|
||||||
taskpool = TaskpoolPtr.new()
|
taskpool = TaskpoolPtr.new(numThreads = min(countProcessors(), 16))
|
||||||
else:
|
else:
|
||||||
taskpool = TaskpoolPtr.new(numThreads = config.numThreads)
|
taskpool = TaskpoolPtr.new(numThreads = config.numThreads)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue