multiprocessing.eclass: Introduce get_nproc() to get no of CPUs
authorMichał Górny <mgorny@gentoo.org>
Tue, 13 Dec 2016 09:08:22 +0000 (10:08 +0100)
committerMichał Górny <mgorny@gentoo.org>
Sun, 18 Dec 2016 13:46:42 +0000 (14:46 +0100)
commitd9cde86b8e01a04b09c3cc7fb328d92428594828
tree92ec1e06b3633a7f201e8262b143bd92b3291ef6
parent639d76a02d2965f426944f7fa6d0259a99a613f9
multiprocessing.eclass: Introduce get_nproc() to get no of CPUs

Introduce get_nproc(), a portable 'nproc' wrapper. It uses either
'nproc' or a fallback Python multiprocessing module call to attempt to
determine the number of available processing units.

This can be used e.g. to determine a safe number of jobs to run when
MAKEOPTS specifies unlimited --jobs and the build system in question
does not support --load-average.
eclass/multiprocessing.eclass