Skip to content

Commit

Permalink
doc: add parallelism note to os.cpus()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cjihrig committed Dec 18, 2022
1 parent a65c309 commit fac2368
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/api/os.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,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
Expand Down

0 comments on commit fac2368

Please sign in to comment.