<div dir="ltr">Hello,<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 25, 2017 at 12:38 AM, Dmitry Kakurin <span dir="ltr"><<a href="mailto:dima_kakurin@hotmail.com" target="_blank">dima_kakurin@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div id="gmail-m_-88027960317730910m_-6976247717624396004divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif" dir="ltr">
<p></p>
<div>When I execute "pid ! msg" and it returns, what are the guarantees if pid and self are on the same node?</div>
<div>Can I assume that by the time it returns, msg is in the pid's queue? And as a result all messages sent to pid afterwards will be queued after msg?</div></div></div></blockquote><div><br></div><div>No you cannot assume that. The message is considered "in transit" until the receiving process inspects it somehow.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-88027960317730910m_-6976247717624396004divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif" dir="ltr">
<div><br>
</div>
<div>The reason I'm asking is because I need a guarantee of proper message ordering in the following scenario when all processes involved are local to a node:</div>
<div>1. A --msg1--> C (process A sends msg1 to process C)</div>
<div>2. A --msg2--> B</div>
<div>3. B --msg2--> C (process B simply proxies msg2 from A to C)</div>
<div><br>
</div>
<div>I need a guarantee that msg2 will always appear in C's queue after msg1.</div></div></div></blockquote><div><br></div><div>You have to do this using messages or some other sync mechanism.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-88027960317730910m_-6976247717624396004divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:calibri,arial,helvetica,sans-serif" dir="ltr">
<div><br>
</div>
<div>P.S. I've read the FAQ 10.8 and 10.9 :-)</div></div></div></blockquote><div><br></div><div>Please add to the FAQ if you think that you can make it clearer on this point. <a href="https://github.com/matthiasl/Erlang-FAQ">https://github.com/matthiasl/Erlang-FAQ</a></div><div><br></div><div>Lukas</div></div></div></div>