summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-10-20 11:51:29 +0200
committerMatheus Marchini <mat@mmarchini.me>2018-10-24 11:20:35 -0300
commit5d80ae3acdd812651b3b193cd31e0b81c214b50e (patch)
treeefb0548ce0f26174dee13feeadab072c2c9461e5 /doc
parent036fbdb63d603a64bd8562ec9331dfb7a5c5075c (diff)
downloadandroid-node-v8-5d80ae3acdd812651b3b193cd31e0b81c214b50e.tar.gz
android-node-v8-5d80ae3acdd812651b3b193cd31e0b81c214b50e.tar.bz2
android-node-v8-5d80ae3acdd812651b3b193cd31e0b81c214b50e.zip
trace_events: forbid tracing modifications from worker threads
Forbid modifying tracing state from worker threads, either through the built-in module or inspector sessions, since the main thread owns all global state, and at least the `async_hooks` integration is definitely not thread safe in its current state. PR-URL: https://github.com/nodejs/node/pull/23781 Fixes: https://github.com/nodejs/node/issues/22767 Refs: https://github.com/nodejs/node/issues/22513 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/tracing.md3
-rw-r--r--doc/api/worker_threads.md2
2 files changed, 5 insertions, 0 deletions
diff --git a/doc/api/tracing.md b/doc/api/tracing.md
index 04db3f12f4..10b2f61ea5 100644
--- a/doc/api/tracing.md
+++ b/doc/api/tracing.md
@@ -82,6 +82,8 @@ as the one used by `process.hrtime()`
however the trace-event timestamps are expressed in microseconds,
unlike `process.hrtime()` which returns nanoseconds.
+The features from this module are not available in [`Worker`][] threads.
+
## The `trace_events` module
<!-- YAML
added: v10.0.0
@@ -205,3 +207,4 @@ console.log(trace_events.getEnabledCategories());
[Performance API]: perf_hooks.html
[V8]: v8.html
[`async_hooks`]: async_hooks.html
+[`Worker`]: worker_threads.html#worker_threads_class_worker
diff --git a/doc/api/worker_threads.md b/doc/api/worker_threads.md
index b73787174c..328bb55c88 100644
--- a/doc/api/worker_threads.md
+++ b/doc/api/worker_threads.md
@@ -253,6 +253,7 @@ Notable differences inside a Worker environment are:
- Execution may stop at any point as a result of [`worker.terminate()`][]
being invoked.
- IPC channels from parent processes are not accessible.
+- The [`trace_events`][] module is not supported.
Currently, the following differences also exist until they are addressed:
@@ -489,6 +490,7 @@ active handle in the event system. If the worker is already `unref()`ed calling
[`SharedArrayBuffer`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer
[Signals events]: process.html#process_signal_events
[`Uint8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
+[`trace_events`]: tracing.html
[browser `MessagePort`]: https://developer.mozilla.org/en-US/docs/Web/API/MessagePort
[child processes]: child_process.html
[HTML structured clone algorithm]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm