4 ms·
ArrayBuffers are just views on underlying memory owned by the thread a V8 isolate is running on. (Each worker runs on a separate thread, each with its own V8 is
by lucacasonato 5y ago
ArrayBuffers are just views on underlying memory owned by the thread a V8 isolate is running on. (Each worker runs on a separate thread, each with its own V8 isolate). When we transfer an ArrayBuffer, we detach the underlying memory from the isolate in the sending thread, and move ownership of the memory area to the receiving thread, where a new JS ArrayBuffer object is created that points to that memory area.
TLDR: The memory is never moved, the pointers to it are just detached from one isolate, and instead passed to another.
- csmpltn 5y agoHats off to you, helping Javascript programmers break out of the matrix ;)