Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang message receiving order

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?

like image 493
Hamidreza Soleimani Avatar asked Jul 19 '26 09:07

Hamidreza Soleimani


1 Answers

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.

like image 152
johlo Avatar answered Jul 21 '26 01:07

johlo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!