[erlang-questions] Receive with priority [yet again]

Scott Lystig Fritchie fritchie@REDACTED
Thu Jan 24 22:42:03 CET 2013


Álvaro <avalormaquedano@REDACTED> wrote:

am> This function will be called periodically and I need to know if this
am> implementation will always go through all the message in the mailbox
am> (i.e. it will try to match Pattern1 to the messages at the beginning
am> of the mailbox over and over again).

Álvaro, compile your module using "erlc -S", then look at the BEAM
assembly for your function ... if the operators 'recv_mark' and
'recv_set' appear (where the argument for recv_set is the same as the
argument for recv_mark), then the function will not scan all messages in
the mailbox.  If you do not see them, then a full mailbox scan will be
done.

-Scott



More information about the erlang-questions mailing list