[erlang-questions] EUC 2006 / proposal to enhance message receive

Christian S <>
Thu Nov 9 11:45:28 CET 2006


I'm not completly convinced that out-of-band message queues is needed.
I simply have not thought enough about the example problem you present
for motivating it. But assuming they are very useful tools. Why do I
just want only one priority mailbox per process? Why not priority over
priority?

PriorityPid = oob(Pid),
PriorityPid ! {a, message}
HigherPriorityPid = oob(PriorityPid),
SuperHighPriorityPid = oob(HigherPriorityPid),.... you get the idea.

That is, store the destination priority in the Pid object.  For
selectively chosing priority queue in receive, introduce a new guard
that only works there.

receive
   Message when priority() > 1 -> ...;
   ...
end



More information about the erlang-questions mailing list