Send Message while processing

Richard Carlsson carlsson.richard@REDACTED
Wed Dec 8 15:13:56 CET 2021


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:

  https://www.erlang.org/blog/parallel-signal-sending-optimization/

And as an Erlang programmer, you don't really have to think about any of
this - it just works.

        /Richard


Den tis 7 dec. 2021 kl 13:07 skrev Dániel Szoboszlay <dszoboszlay@REDACTED
>:

> Hi,
>
> 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.
>
> Hope it helps,
> Daniel
>
> On Tue, 7 Dec 2021 at 12:46, Γιάννης Γεωργίου <ggeorgiou@REDACTED> wrote:
>
>>
>> Hi,
>>
>> If process A doing a long work and in the same time process B send
>> message to A , I believe that it will successfully recieve the message
>> in A's mailbox. So mailboxes of processes are processes too? If not how
>> it can save the message while is doing some work?
>>
>> Thanks for your time.
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20211208/8e7ac913/attachment.htm>


More information about the erlang-questions mailing list