[erlang-questions] On selective receive (Re: eep: multiple patterns)

Ulf Wiger <>
Sat May 31 09:36:33 CEST 2008

Actually, I assume that in just about all cases where you
have a process that needs selective receive semantics,
it's probably perfectly ok to set a low limit on the maximum
length of the message queue. A buffering process could
be placed in front of it, which might also normally do
dispatch. It would not use selective receive, and so wouldn't
suffer much from a large message queue.

Ulf W

2008/5/31 Ulf Wiger <>:

> An old legacy Ericsson system implemented selective receive
> in a way that the message queue could hold at most 6 messages.
> Any more than that was obviously an error.
> I think it might be useful to be able to specify such a limit as
> a spawn option, perhaps together with maximum heap size.
> Exceeding the limit could perhaps lead to the process being
> killed (which might seem backwards in the case of the message
> queue, but at least gives a visible indication), or that the sender
> process would be suspended (which could potentially lead to the
> whole system stopping.)
> BR,
> Ulf W

More information about the erlang-questions mailing list