Atomics

A JavaScript object of functions that read and change shared memory in steps that cannot be interrupted by another thread.

In more detail

Atomics.add(view, 0, 1) always increments correctly even if two threads do it at once, which an ordinary += does not. Atomics.wait() and Atomics.notify() let threads sleep until another thread signals them.

Related terms

Taught in

References