-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
worker: initial implementation #20876
Commits on Jun 5, 2018
-
src: cleanup per-isolate state on platform on isolate unregister
Clean up once all references to an `Isolate*` are gone from the `NodePlatform`, rather than waiting for the `PerIsolatePlatformData` struct to be deleted since there may be cyclic references between that struct and the individual tasks.
Configuration menu - View commit details
-
Copy full SHA for f0ded20 - Browse repository at this point
Copy the full SHA f0ded20View commit details -
src: remove unused fields isolate_
Currently the following compiler warnings are generated: In file included from ../src/node_platform.cc:1: ../src/node_platform.h:83:16: warning: private field 'isolate_' is not used [-Wunused-private-field] v8::Isolate* isolate_; ^ 1 warning generated. This commit removes these unused private member.
Configuration menu - View commit details
-
Copy full SHA for 2bb055b - Browse repository at this point
Copy the full SHA 2bb055bView commit details -
Remove one extra closing state and use a smart pointer for deleting `HandleWrap`s.
Configuration menu - View commit details
-
Copy full SHA for e7695cc - Browse repository at this point
Copy the full SHA e7695ccView commit details -
src: make handle onclose property a Symbol
This makes the property “more” hidden when exposing a `HandleWrap` as public API, e.g. for upcoming `MessagePort`s.
Configuration menu - View commit details
-
Copy full SHA for 6d4931a - Browse repository at this point
Copy the full SHA 6d4931aView commit details -
worker: implement
MessagePort
andMessageChannel
Implement `MessagePort` and `MessageChannel` along the lines of the DOM classes of the same names. `MessagePort`s initially support transferring only `ArrayBuffer`s. Thanks to Stephen Belanger for reviewing this change in its original form, to Benjamin Gruenbaum for reviewing the added tests in their original form, and to Olivia Hugger for reviewing the documentation in its original form. Refs: ayojs/ayo#98
Configuration menu - View commit details
-
Copy full SHA for 315efb5 - Browse repository at this point
Copy the full SHA 315efb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for f2e297b - Browse repository at this point
Copy the full SHA f2e297bView commit details -
worker: support MessagePort passing in messages
Support passing `MessagePort` instances through other `MessagePort`s, as expected by the `MessagePort` spec. Thanks to Stephen Belanger for reviewing this change in its original PR. Refs: ayojs/ayo#106
Configuration menu - View commit details
-
Copy full SHA for ef24c5c - Browse repository at this point
Copy the full SHA ef24c5cView commit details -
worker: add
SharedArrayBuffer
sharingLogic is added to the `MessagePort` mechanism that attaches hidden objects to those instances when they are transferred that track their lifetime and maintain a reference count, to make sure that memory is freed at the appropriate times. Thanks to Stephen Belanger for reviewing this change in its original PR. Refs: ayojs/ayo#106
Configuration menu - View commit details
-
Copy full SHA for a57c54f - Browse repository at this point
Copy the full SHA a57c54fView commit details -
src: remove unused fields msg_ and env_
Currently the following compiler warnings are generated: ../src/node_messaging.cc:74:16: warning: private field 'env_' is not used [-Wunused-private-field] Environment* env_; ^ ../src/node_messaging.cc:75:12: warning: private field 'msg_' is not used [-Wunused-private-field] Message* msg_; ^ 2 warnings generated. This commit removes these unused private members.
Configuration menu - View commit details
-
Copy full SHA for ca0edc1 - Browse repository at this point
Copy the full SHA ca0edc1View commit details -
src: add Env::profiler_idle_notifier_started()
Refs: ayojs/ayo#93 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d2d9061 - Browse repository at this point
Copy the full SHA d2d9061View commit details -
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: ayojs/ayo#110 Refs: ayojs/ayo#114 Refs: ayojs/ayo#117
Configuration menu - View commit details
-
Copy full SHA for 0c7012e - Browse repository at this point
Copy the full SHA 0c7012eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 396d785 - Browse repository at this point
Copy the full SHA 396d785View commit details -
Configuration menu - View commit details
-
Copy full SHA for 65d4542 - Browse repository at this point
Copy the full SHA 65d4542View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0535eb - Browse repository at this point
Copy the full SHA d0535ebView commit details -
test: add test against unsupported worker features
Refs: ayojs/ayo#113 Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 17e01a2 - Browse repository at this point
Copy the full SHA 17e01a2View commit details -
worker: restrict supported extensions
Only allow `.js` and `.mjs` extensions to provide future-proofing for file type detection. Refs: ayojs/ayo#117 Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Olivia Hugger <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 53b660b - Browse repository at this point
Copy the full SHA 53b660bView commit details -
Provide `stdin`, `stdout` and `stderr` options for the `Worker` constructor, and make these available to the worker thread under their usual names. The default for `stdin` is an empty stream, the default for `stdout` and `stderr` is redirecting to the parent thread’s corresponding stdio streams.
Configuration menu - View commit details
-
Copy full SHA for 004075b - Browse repository at this point
Copy the full SHA 004075bView commit details -
benchmark: port cluster/echo to worker
$ ./node benchmark/cluster/echo.js cluster/echo.js n=100000 sendsPerBroadcast=1 payload="string" workers=1: 33,647.30473442063 cluster/echo.js n=100000 sendsPerBroadcast=10 payload="string" workers=1: 12,927.907405288383 cluster/echo.js n=100000 sendsPerBroadcast=1 payload="object" workers=1: 28,496.37373941151 cluster/echo.js n=100000 sendsPerBroadcast=10 payload="object" workers=1: 8,975.53747186485 $ ./node --experimental-worker benchmark/worker/echo.js worker/echo.js n=100000 sendsPerBroadcast=1 payload="string" workers=1: 88,044.32902365089 worker/echo.js n=100000 sendsPerBroadcast=10 payload="string" workers=1: 39,873.33697018837 worker/echo.js n=100000 sendsPerBroadcast=1 payload="object" workers=1: 64,451.29132425621 worker/echo.js n=100000 sendsPerBroadcast=10 payload="object" workers=1: 22,325.635443739284 Refs: ayojs/ayo#115 Reviewed-By: Anna Henningsen <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for d44594d - Browse repository at this point
Copy the full SHA d44594dView commit details -
worker: improve error (de)serialization
Rather than passing errors using some sort of string representation, do a best effort for faithful serialization/deserialization of uncaught exception objects.
Configuration menu - View commit details
-
Copy full SHA for fa53bd5 - Browse repository at this point
Copy the full SHA fa53bd5View commit details -
test,tools: enable running tests under workers
Enable running tests inside workers by passing `--worker` to `tools/test.py`. A number of tests are marked as skipped, or have been slightly altered to fit the different environment.
Configuration menu - View commit details
-
Copy full SHA for 79970f3 - Browse repository at this point
Copy the full SHA 79970f3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 168d8a6 - Browse repository at this point
Copy the full SHA 168d8a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for a12f76f - Browse repository at this point
Copy the full SHA a12f76fView commit details -
Configuration menu - View commit details
-
Copy full SHA for ab02dbc - Browse repository at this point
Copy the full SHA ab02dbcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2947dea - Browse repository at this point
Copy the full SHA 2947deaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 735227e - Browse repository at this point
Copy the full SHA 735227eView commit details -
Configuration menu - View commit details
-
Copy full SHA for cbbddea - Browse repository at this point
Copy the full SHA cbbddeaView commit details