Skip to content

Commit fac2368

Browse files
committed
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.
1 parent a65c309 commit fac2368

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/os.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ The properties included on each object include:
138138
`nice` values are POSIX-only. On Windows, the `nice` values of all processors
139139
are always 0.
140140

141+
`os.cpus().length` should not be used to calculate the amount of parallelism
142+
available to an application. Use
143+
[`os.availableParallelism()`](#osavailableparallelism) for this purpose.
144+
141145
## `os.devNull`
142146

143147
<!-- YAML

0 commit comments

Comments
 (0)