mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
doc: add parallelism note to os.cpus()
With the introduction of os.availableParallelism(), users should no longer rely on os.cpus().length to determine the amount of available parallelism. This commit adds a note to the os.cpus() docs. PR-URL: https://github.com/nodejs/node/pull/45895 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
@@ -140,6 +140,10 @@ The properties included on each object include:
|
||||
`nice` values are POSIX-only. On Windows, the `nice` values of all processors
|
||||
are always 0.
|
||||
|
||||
`os.cpus().length` should not be used to calculate the amount of parallelism
|
||||
available to an application. Use
|
||||
[`os.availableParallelism()`](#osavailableparallelism) for this purpose.
|
||||
|
||||
## `os.devNull`
|
||||
|
||||
<!-- YAML
|
||||
|
||||
Reference in New Issue
Block a user