简体   繁体   中英

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM