diff options
author | Anna Henningsen <anna@addaleax.net> | 2017-09-01 17:03:41 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-06-06 19:43:52 +0200 |
commit | 0df031acadcc6490379d72676203a980c8d60592 (patch) | |
tree | 3f49864e72b0193ea9af937874f62c6316877ec4 /doc/api/process.md | |
parent | 8939f36630bd718fc0b0b8557cf7f2ed9ecab312 (diff) | |
download | android-node-v8-0df031acadcc6490379d72676203a980c8d60592.tar.gz android-node-v8-0df031acadcc6490379d72676203a980c8d60592.tar.bz2 android-node-v8-0df031acadcc6490379d72676203a980c8d60592.zip |
worker: initial implementation
Implement multi-threading support for most of the API.
Thanks to Stephen Belanger for reviewing this change in its
original form, to Olivia Hugger for reviewing the
documentation and some of the tests coming along with it,
and to Alexey Orlenko and Timothy Gu for reviewing other
parts of the tests.
Refs: https://github.com/ayojs/ayo/pull/110
Refs: https://github.com/ayojs/ayo/pull/114
Refs: https://github.com/ayojs/ayo/pull/117
PR-URL: https://github.com/nodejs/node/pull/20876
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'doc/api/process.md')
-rw-r--r-- | doc/api/process.md | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/doc/api/process.md b/doc/api/process.md index 8205efbd78..0a9c52a44c 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -410,6 +410,8 @@ added: v0.7.0 The `process.abort()` method causes the Node.js process to exit immediately and generate a core file. +This feature is not available in [`Worker`][] threads. + ## process.arch <!-- YAML added: v0.5.0 @@ -517,6 +519,8 @@ try { } ``` +This feature is not available in [`Worker`][] threads. + ## process.config <!-- YAML added: v0.7.7 @@ -918,6 +922,8 @@ console.log(process.env.test); // => 1 ``` +`process.env` is read-only in [`Worker`][] threads. + ## process.execArgv <!-- YAML added: v0.7.7 @@ -1030,6 +1036,9 @@ If it is necessary to terminate the Node.js process due to an error condition, throwing an *uncaught* error and allowing the process to terminate accordingly is safer than calling `process.exit()`. +In [`Worker`][] threads, this function stops the current thread rather +than the current process. + ## process.exitCode <!-- YAML added: v0.11.8 @@ -1203,6 +1212,7 @@ console.log(process.getgroups()); // [ 27, 30, 46, 1000 ] This function is only available on POSIX platforms (i.e. not Windows or Android). +This feature is not available in [`Worker`][] threads. ## process.kill(pid[, signal]) <!-- YAML @@ -1306,6 +1316,9 @@ The _heap_ is where objects, strings, and closures are stored. Variables are stored in the _stack_ and the actual JavaScript code resides in the _code segment_. +When using [`Worker`][] threads, `rss` will be a value that is valid for the +entire process, while the other fields will only refer to the current thread. + ## process.nextTick(callback[, ...args]) <!-- YAML added: v0.1.26 @@ -1569,6 +1582,7 @@ if (process.getegid && process.setegid) { This function is only available on POSIX platforms (i.e. not Windows or Android). +This feature is not available in [`Worker`][] threads. ## process.seteuid(id) <!-- YAML @@ -1596,6 +1610,7 @@ if (process.geteuid && process.seteuid) { This function is only available on POSIX platforms (i.e. not Windows or Android). +This feature is not available in [`Worker`][] threads. ## process.setgid(id) <!-- YAML @@ -1623,6 +1638,7 @@ if (process.getgid && process.setgid) { This function is only available on POSIX platforms (i.e. not Windows or Android). +This feature is not available in [`Worker`][] threads. ## process.setgroups(groups) <!-- YAML @@ -1639,6 +1655,7 @@ The `groups` array can contain numeric group IDs, group names or both. This function is only available on POSIX platforms (i.e. not Windows or Android). +This feature is not available in [`Worker`][] threads. ## process.setuid(id) <!-- YAML @@ -1664,6 +1681,7 @@ if (process.getuid && process.setuid) { This function is only available on POSIX platforms (i.e. not Windows or Android). +This feature is not available in [`Worker`][] threads. ## process.setUncaughtExceptionCaptureCallback(fn) <!-- YAML @@ -1700,6 +1718,8 @@ a [Writable][] stream. `process.stderr` differs from other Node.js streams in important ways, see [note on process I/O][] for more information. +This feature is not available in [`Worker`][] threads. + ## process.stdin * {Stream} @@ -1732,6 +1752,8 @@ In "old" streams mode the `stdin` stream is paused by default, so one must call `process.stdin.resume()` to read from it. Note also that calling `process.stdin.resume()` itself would switch stream to "old" mode. +This feature is not available in [`Worker`][] threads. + ## process.stdout * {Stream} @@ -1750,6 +1772,8 @@ process.stdin.pipe(process.stdout); `process.stdout` differs from other Node.js streams in important ways, see [note on process I/O][] for more information. +This feature is not available in [`Worker`][] threads. + ### A note on process I/O `process.stdout` and `process.stderr` differ from other Node.js streams in @@ -1865,6 +1889,8 @@ console.log( ); ``` +This feature is not available in [`Worker`][] threads. + ## process.uptime() <!-- YAML added: v0.5.0 @@ -1992,6 +2018,7 @@ cases: [`ChildProcess`]: child_process.html#child_process_class_childprocess [`Error`]: errors.html#errors_class_error [`EventEmitter`]: events.html#events_class_eventemitter +[`Worker`]: worker.html#worker_worker [`console.error()`]: console.html#console_console_error_data_args [`console.log()`]: console.html#console_console_log_data_args [`domain`]: domain.html |