Does Erlang always copy messages between processes on the same node? -
A reliable implementation of the message-passing words means that message content is logical point of View, even for the irreversible type. Deep-copy of the message contents, the actor model remains an obstacle for implementation, so some implementations for the display support zero-copy messages (although it is still deeply with the point-viewer of the programmer).
Is zero-copy message-passing applied in all in Erlang? This can not be explicitly implemented between the nodes, but what is the process between the same node? Is related.
I do not think your claim is absolutely correct - the deep copy of the inter-process message is a hindrance in Erlang. And with the default VM build / settings, this is exactly what all Erlang systems are doing.
The Erlang process piles are completely different from each other, and the message queue is located in the process pile, so the messages should be copied. This is also true for transferring data to ETS tables as their data is collected from the process pile in different allocation zones.
Although many shared datastructures are large binary (> 64 bytes long) usually allocated in the node-wide area and reference is counted. Erlong processes references to these binaries. This means that if you make a large binary and send it to another process, then you are only sending the reference.
Sending data between processes is really bad in terms of the size of the allocation compared to what you think - sharing in. One word is not preserved during a copy, this means that if you have memory If you make words with care to reduce consumption, it will increase your assurances in the other process. You can see a practical example in OTP. As Nicholas Gradoval said, VM was an experimental hybrid pile mode, which allowed the words to be shared between processes and passed a zero-copy message. This is not a particularly promising experiment as I think - extra locking is required for this and independently makes the existing capacity of processes complicated to collect garbage. Not only is it copying the inter-process messages, which does not hinder the Irang system as always, so that actually reduces the performance.
Comments
Post a Comment