Hacker News new | ask | show | jobs
by Jarred 2095 days ago
Does message passing mean it copies objects you send between threads / fibers, rather than sharing memory?

JavaScript has a similar pattern with Workers, and it makes concurrency for hot code impractical. Serializing/deserializing objects is a lot slower than just not doing that. In JavaScript’s case, you can also use SharedArrayBuffer, but Safari hasn’t re-enabled it.

1 comments

IIUC Yes. Although there are some cases where it can share immutable objects or pass ownership.

However you can always just open a shared memory region and write bytes back and forth. You don't get ruby types but if you are worried about performance that probably isn't much of a concern.