Cazineer
Cazineer

Reputation: 2405

Node.js shared memory and atomics documentation and how tos

It appears shared memory and atomics was added in Node 9.0.0: http://node.green/#ES2017-features-shared-memory-and-atomics-Atomics-add

I'm trying to find the official documentation but can't seem to locate it at: https://nodejs.org/api/index.html

Anyone know where it might be located?

Upvotes: 3

Views: 2860

Answers (2)

Nidin Vinayakan
Nidin Vinayakan

Reputation: 1227

Here you can find a Node.js + AssemblyScript multithreading boilerplate code.

Repo : as-multithreading-boilerplate

Dependencies

This repo shows

  1. Basic setup to do multithreading using nodejs worker_threads
  2. Basic WebAssembly multithreading with AssemblyScript
  3. Atomic WebAssembly memory allocator

Upvotes: 0

Cazineer
Cazineer

Reputation: 2405

EVOLVING ANSWER

It appears that Node 9.0.0 supports SharedArrayBuffer which can be found on MDN at: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer

and atomics: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Atomics/store

This was added to Node.js in v9.0.0: http://node.green/#ES2017-features-shared-memory-and-atomics-SharedArrayBuffer

I will continue to document everything I learn on this for others who are interested in utilizing this in Node.js.

YouTube Videos Nidin Vinayakan: Shared Memory & Parallel Programming with JavaScript | JSConf EU 2017 https://www.youtube.com/watch?v=vvqfmskTIjE

Upvotes: 4

Related Questions