1

I have some work being done on a WebWorker. When I post an object back to my GUI thread, the Javascript engine uses the structured cloning algorithm to clone the object with the GUI thread receiving a cloned object.

My question is, where is the cloning work being done, on the sender (WebWorker), receiver (GUI thread), both, or have I got completely the wrong end of the stick?

Cheetah
  • 13,785
  • 31
  • 106
  • 190

1 Answers1

0

You can only send message width cloned data. And as there is no communication between threads except postMessages, there is no way receiver can perform structured cloning. SO cloning work is implemented on thread that sends a message.

Anton Stepanenkov
  • 1,026
  • 8
  • 15