Skip to main content

SharedArrayBuffer

SharedArrayBuffer is an object that holds a fixed-length binary buffer. You can pass around comparably longer data with SharedArrayBuffer between agents (i.e., main thread and worker.) A change in one ShardArrayBuffer will reflect on the other side.

const sab = new SharedArrayBuffer(1024)
worker.postMessage(sab)

The Spectre vulnerability seized ShardArrayBuffer in 2018, and since 2020, ShardArrayBuffer requires a Secure Context to run.

For the host document, I need two headers to enable ShardArrayBuffer.

Links to This Note

WorkerDOM

WorkerDOM doesn't use SharedArrayBuffer, most likely to Spectre.

Snowpack์œผ๋กœ WASM ์‹œ์ž‘ํ•˜๊ธฐ

... ๋‹ค๋งŒ Safari์™€ Firefox์—์„œ๋Š” ์ž‘๋™๋˜์ง€ ์•Š์•˜๋‹ค. "SharedArrayBuffer is not defined"์ด๋ผ๋Š” ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค.

Providing DOM API to Worker Threads

To enable SharedArrayBuffer, we need a secure context ...

Proposal of Research 2023-03-28

... such as Web Worker|Web Workers, SharedArrayBuffer, and WebAssembly, iiframe will revolutionize ...

Proposal of Research 2023-01-10

... race conditions, we need a SharedArrayBuffer and Atomic operations. SharedArrayBuffer is ...

Atomics (JavaScript)

- SharedArrayBuffer๋ฅผ ์ด์šฉํ•ด Web Worker ์‚ฌ์ด ๋ฉ”๋ชจ๋ฆฌ๋ฅผ ...

2023-02-16

... modern Web Browser|browser technologies like SharedArrayBuffer, which makes it impossible to ...

2022-08-03

... synchronously using Atomics (JavaScript) and SharedArrayBuffer.

2022-07-25

- [x] Allocate a SharedArrayBuffer inside `transferSync`.

2022-07-21

- Allocate a SharedArrayBuffer inside `transferSync`.

2022-07-19

... - Web Worker Thread `transferSync`์—์„œ SAB๋ฅผ ํ•˜๋‚˜ ํ• ๋‹นํ•œ๋‹ค

2022-07-12

...   - This involves SAB

2022-07-11

... but is internally made with SharedArrayBuffer.

2022-06-27

... more about Atomics (JavaScript) and SharedArrayBuffer

2022-06-26

- Explore SharedArrayBuffer, Atomic, and WorkerDOM's Binary DOM ...

2022-06-22

...  - WorkerDOM will harness SharedArrayBuffer.