From fbebd408dcf5d7b4b2d02e96d484d439d6ac799e Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Thu, 16 Jan 2020 07:25:22 -0500 Subject: [PATCH 1/4] doc: visibility of Worker threads cli options fixes: https://github.com/nodejs/node/issues/28518 --- doc/api/cli.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/cli.md b/doc/api/cli.md index 673a3d5a75fbd6..4cc2d7ea904389 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -6,6 +6,9 @@ Node.js comes with a variety of CLI options. These options expose built-in debugging, multiple ways to execute scripts, and other helpful runtime options. +Worker threads inherit non-process-specific options by default. Refer to +[`Worker constructor options`][] to know how to customize worker thread options. + To view this documentation as a manual page in a terminal, run `man node`. ## Synopsis @@ -1371,6 +1374,7 @@ greater than `4` (its current default value). For more information, see the [`tls.DEFAULT_MAX_VERSION`]: tls.html#tls_tls_default_max_version [`tls.DEFAULT_MIN_VERSION`]: tls.html#tls_tls_default_min_version [`unhandledRejection`]: process.html#process_event_unhandledrejection +[`Worker constructor options`]: worker_threads.html#worker_threads_new_worker_filename_options [Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/ [Conditional Exports]: esm.html#esm_conditional_exports [REPL]: repl.html From c443fabae76e95b5a3b16f6ec75d59b91d2f70cc Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Thu, 23 Jan 2020 01:12:58 -0500 Subject: [PATCH 2/4] fixup: address review comments --- doc/api/cli.md | 4 ---- doc/api/worker_threads.md | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/cli.md b/doc/api/cli.md index 4cc2d7ea904389..673a3d5a75fbd6 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -6,9 +6,6 @@ Node.js comes with a variety of CLI options. These options expose built-in debugging, multiple ways to execute scripts, and other helpful runtime options. -Worker threads inherit non-process-specific options by default. Refer to -[`Worker constructor options`][] to know how to customize worker thread options. - To view this documentation as a manual page in a terminal, run `man node`. ## Synopsis @@ -1374,7 +1371,6 @@ greater than `4` (its current default value). For more information, see the [`tls.DEFAULT_MAX_VERSION`]: tls.html#tls_tls_default_max_version [`tls.DEFAULT_MIN_VERSION`]: tls.html#tls_tls_default_min_version [`unhandledRejection`]: process.html#process_event_unhandledrejection -[`Worker constructor options`]: worker_threads.html#worker_threads_new_worker_filename_options [Chrome DevTools Protocol]: https://chromedevtools.github.io/devtools-protocol/ [Conditional Exports]: esm.html#esm_conditional_exports [REPL]: repl.html diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 6812e6966dae66..619057bed6fc0b 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -49,6 +49,9 @@ The above example spawns a Worker thread for each `parse()` call. In actual practice, use a pool of Workers instead for these kinds of tasks. Otherwise, the overhead of creating Workers would likely exceed their benefit. +Worker threads inherit non-process-specific options by default. Refer to +[`Worker constructor options`][] to know how to customize worker thread options. + When implementing a worker pool, use the [`AsyncResource`][] API to inform diagnostic tools (e.g. in order to provide asynchronous stack traces) about the correlation between tasks and their outcomes. @@ -744,6 +747,7 @@ active handle in the event system. If the worker is already `unref()`ed calling [`require('worker_threads').workerData`]: #worker_threads_worker_workerdata [`trace_events`]: tracing.html [`vm`]: vm.html +[`Worker constructor options`]: #worker_threads_new_worker_filename_options [`worker.on('message')`]: #worker_threads_event_message_1 [`worker.postMessage()`]: #worker_threads_worker_postmessage_value_transferlist [`worker.SHARE_ENV`]: #worker_threads_worker_share_env From 086b9922175decd1534121b8d7f6a35acf85e8d4 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Thu, 23 Jan 2020 01:21:28 -0500 Subject: [PATCH 3/4] fixup: address review comment --- doc/api/worker_threads.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 619057bed6fc0b..7627c23467b356 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -50,7 +50,8 @@ practice, use a pool of Workers instead for these kinds of tasks. Otherwise, the overhead of creating Workers would likely exceed their benefit. Worker threads inherit non-process-specific options by default. Refer to -[`Worker constructor options`][] to know how to customize worker thread options. +[`Worker constructor options`][] to know how to customize worker thread options, +specifically `argv` and `execArgv` options. When implementing a worker pool, use the [`AsyncResource`][] API to inform diagnostic tools (e.g. in order to provide asynchronous stack traces) about the From 7e871d197e43823262c07440563e1c479584f650 Mon Sep 17 00:00:00 2001 From: Harshitha KP Date: Wed, 12 Feb 2020 01:22:45 -0500 Subject: [PATCH 4/4] fixup: address review comment --- doc/api/worker_threads.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md index 7627c23467b356..e4275e6e9fe51f 100644 --- a/doc/api/worker_threads.md +++ b/doc/api/worker_threads.md @@ -49,14 +49,14 @@ The above example spawns a Worker thread for each `parse()` call. In actual practice, use a pool of Workers instead for these kinds of tasks. Otherwise, the overhead of creating Workers would likely exceed their benefit. -Worker threads inherit non-process-specific options by default. Refer to -[`Worker constructor options`][] to know how to customize worker thread options, -specifically `argv` and `execArgv` options. - When implementing a worker pool, use the [`AsyncResource`][] API to inform diagnostic tools (e.g. in order to provide asynchronous stack traces) about the correlation between tasks and their outcomes. +Worker threads inherit non-process-specific options by default. Refer to +[`Worker constructor options`][] to know how to customize worker thread options, +specifically `argv` and `execArgv` options. + ## `worker.isMainThread`