Why os.availableparallelism() over os.cpus().length? #4743
-
I'm just curious about what the problems are with use os.cpus().length when trying to calculate available parallelism. I see in the docs that you should use |
Beta Was this translation helpful? Give feedback.
Answered by
bnoordhuis
Jun 29, 2023
Replies: 0 comments 1 reply
-
libuv/libuv#3493 (comment) - in a nutshell: os.cpus() returns the online cpus but that doesn't help you if you're pinned to a subset of them. it's supposed to be explained in the docs but maybe it's only in the libuv docs at the moment. PR welcome if that's the case. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
cjihrig
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
libuv/libuv#3493 (comment) - in a nutshell: os.cpus() returns the online cpus but that doesn't help you if you're pinned to a subset of them.
it's supposed to be explained in the docs but maybe it's only in the libuv docs at the moment. PR welcome if that's the case.