12 ms·
SharedArrayBuffer -> shared ArrayBuffer -> ownership can be transferred around, but the data can only be owned by one thread at a time. The data itself isn't c
by rndgermandude 8y ago
SharedArrayBuffer -> shared
ArrayBuffer -> ownership can be transferred around, but the data can only be owned by one thread at a time. The data itself isn't copied. Passing around ArrayBuffers back and forth is good enough for a lot of stuff.
In a worker you can then put a node Buffer, TypedArray, or DataView around the ArrayBuffer again, if you want.