Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 53684e4

Browse filesBrowse files
cjihrigjuanarbol
authored andcommitted
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: #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>
1 parent b2facef commit 53684e4
Copy full SHA for 53684e4

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/os.md‎

Copy file name to clipboardExpand all lines: doc/api/os.md
+4Lines changed: 4 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ The properties included on each object include:
140140
`nice` values are POSIX-only. On Windows, the `nice` values of all processors
141141
are always 0.
142142

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

145149
<!-- YAML

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.