MDN self-hosted library · e01.org
Atomics.notify() / notebook

Atomics.notify()

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

js
const sab = new SharedArrayBuffer(1024);
const int32 = new Int32Array(sab);
js
Atomics.wait(int32, 0, 0);
console.log(int32[0]); // 123
js
console.log(int32[0]); // 0;
Atomics.store(int32, 0, 123);
Atomics.notify(int32, 0, 1);