Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSWorker threads basicsSingle-choice MCQ

What is the practical effect of creating a Worker with the SharedArrayBuffer below and writing to it from the worker?

const sab = new SharedArrayBuffer(4); const view = new Int32Array(sab); const w = new Worker('./inc.js', { workerData: sab }); // inc.js: const v = new Int32Array(workerData); Atomics.add(v, 0, 5);