4 ms·
Does message passing mean it copies objects you send between threads / fibers, rather than sharing memory? JavaScript has a similar pattern with Workers, and i
by Jarred 6y 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.
- kevincox 6y agoIIUC 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.