Question

With the knowledge of these facts about time-order of Erlang message passing behaviour:

If process A sends two messages to process B, then the two messages are guaranteed to arrive in the order they are sent.

If process A sends a message to process B and then a message to process C, there's no guarantee as to the ordering in which they are received.

Similarly, if processes A & B send messages to C, there's no guarantee as to the order in which the messages are received.

My question is:

What is the receive order if process A and B send a message to process C, when A and B send its message exactly in a same (micro) time, with a same inner functionality, in the same node and in the same machine which can run parallel processes?

Was it helpful?

Solution

You can't make any assumptions about the receive order in that case either. The receive order will depend on factors such as when the processes are scheduled to run and can differ between different runs of the same code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top