[erlang-questions] erlang:process_info(Pid, messages) result order

Daniil Churikov ddosia@REDACTED
Thu Aug 21 20:23:54 CEST 2014


That make sense, thanks!


2014-08-21 18:10 GMT+04:00 Michael Klishin <michael.s.klishin@REDACTED>:

> On 21 August 2014 at 18:07:33, Daniil Churikov (ddosia@REDACTED) wrote:
> > > Hello, I just spotted one counterintuitive thing for me: when
> > you send messages to process,
> > and then access it's mailbox via erlang:process_info(Pid,
> > messages), all messages you sent
> > is in the same order, oldest messages in the list's head!
> >
> > Example:
> >
> > self() ! m1,
> > self() ! m2,
> > self() ! m3,
> > {messages,[m1,m2,m3]} = erlang:process_info(self(), messages).
> >
> > My expectations was that newest messages will be at the head of
> > the list.
>
> How would old messages get a chance at being processed at high message
> rates, if the order wasn't FIFO?
> --
> @michaelklishin, github.com/michaelklishin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140821/f01390c1/attachment.htm>


More information about the erlang-questions mailing list