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 ffab924

Browse filesBrowse files
tniessenBethGriggs
authored andcommitted
doc: suggest worker threads in cluster docs
The current documentation is incorrect in that it says "A single instance of Node.js runs in a single thread," which is not true due to the addition of worker threads. This patch removes the incorrect statement and instead suggests that applications consider using worker threads when process isolation is not needed. Refs: #20876 PR-URL: #41616 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
1 parent ea6c202 commit ffab924
Copy full SHA for ffab924

File tree

Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/cluster.md‎

Copy file name to clipboardExpand all lines: doc/api/cluster.md
+5-3Lines changed: 5 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
77
<!-- source_link=lib/cluster.js -->
88

9-
A single instance of Node.js runs in a single thread. To take advantage of
10-
multi-core systems, the user will sometimes want to launch a cluster of Node.js
11-
processes to handle the load.
9+
Clusters of Node.js processes can be used to run multiple instances of Node.js
10+
that can distribute workloads among their application threads. When process
11+
isolation is not needed, use the [`worker_threads`][] module instead, which
12+
allows running multiple application threads within a single Node.js instance.
1213

1314
The cluster module allows easy creation of child processes that all share
1415
server ports.
@@ -1121,3 +1122,4 @@ socket.on('data', (id) => {
11211122
[`process` event: `'message'`]: process.md#event-message
11221123
[`server.close()`]: net.md#event-close
11231124
[`worker.exitedAfterDisconnect`]: #workerexitedafterdisconnect
1125+
[`worker_threads`]: worker_threads.md

0 commit comments

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