<div dir="ltr">Here is a very good recent blog post by the OTP team explaining how the message queue locking works and the new optimizations they have just done to make it scale even better:<div><br></div><div> <a href="https://www.erlang.org/blog/parallel-signal-sending-optimization/">https://www.erlang.org/blog/parallel-signal-sending-optimization/</a><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br></div><div class="gmail_signature" data-smartmail="gmail_signature">And as an Erlang programmer, you don't really have to think about any of this - it just works.</div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br> /Richard</div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Den tis 7 dec. 2021 kl 13:07 skrev Dániel Szoboszlay <<a href="mailto:dszoboszlay@gmail.com">dszoboszlay@gmail.com</a>>:<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">Hi,<div><br></div><div>No, the mailbox is not a process. It's a data structure that belongs to the process (just like its heap, for example). If process B sends a message to A, it will be the scheduler executing B that writes the message into that data structure. Process A can be busy doing something else on a different scheduler, it doesn't have to be involved. There are locks protecting the mailbox from concurrent access of course, so if A is doing something with its mailbox at the very same moment, then B will have to wait a little. But the Erlang VM is carefully written to spend very little time within such critical sections, so you won't notice this wait in practice.</div><div><br></div><div>Hope it helps,</div><div>Daniel</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 7 Dec 2021 at 12:46, Γιάννης Γεωργίου <<a href="mailto:ggeorgiou@union.gr" target="_blank">ggeorgiou@union.gr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Hi,<br>
<br>
If process A doing a long work and in the same time process B send <br>
message to A , I believe that it will successfully recieve the message <br>
in A's mailbox. So mailboxes of processes are processes too? If not how <br>
it can save the message while is doing some work?<br>
<br>
Thanks for your time.<br>
<br>
</blockquote></div>
</blockquote></div>