Adds the JavaScript type SharedArrayBuffer gated behind COOP/COEP. The concept of a SharedArrayBuffer is that a message to a worker, is posted but instead of copying the content of the array just a reference to it is shared. The Atomic API provides atomic loads and stores and Read/Modify/Write accesses to SharedArrayBuffers. The Atomic.wait provides the ability for a worker to wait for another worker to signal it, without having to spinlock.

Documentation

Specification

Established standard

Status in Chromium

Blink>JavaScript


Enabled by default (tracking bug) in:

  • Chrome for desktop release 60
  • Chrome for Android release 88

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

Owners

Comments

It has a primary use case for asm.js code, but is also useful for implementing other higher-level sharing between Workers. See https://blog.mozilla.org/javascript/2015/02/26/the-path-to-parallel-javascript/ for some discussion of the possibilities. It also is likely to be how future WebAssembly shared memory is exposed to Web APIS. Note that Chrome's implementation of SharedArrayBuffer contains a non-standard attribute: SharedArrayBuffer.isView. The Blink team has an intent to remove it.

Search tags

SharedArrayBuffer, SAB,

Last updated on 2020-12-10