Node.js · Senior · Question 15 of 75

What is a good way to share large binary data between worker threads without copying?

Explanation

Transferring moves ownership: the sender can no longer use the buffer. SharedArrayBuffer lets both sides read and write the same memory, so use Atomics to avoid races.

Further reading

Problem with a question

Node.js · Senior · question 15

Test yourself

Take the Node.js · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz