Can there be limits on message queue length?
Thu Jan 5 02:48:52 CET 2006
Sean Hinde wrote:
> On 4 Jan 2006, at 21:39, David Hopwood wrote:
>> Rick Pettit wrote:
>>> On Tue, Jan 03, 2006 at 01:21:32PM +0000, Joel Reymont wrote:
>>>> To add to my list of questions...
>>>> Are there any limits on the size of the receive queue in Erlang?
>>> I entered your exact question into google and the first link that
>>> popped up was the Erlang FAQ--try reading that.
>>> You might even want to skip to the following section:
>>> 10.8.3. What limits does Erlang have?
>>> There you will find a link to even more information, and so on.
>> Neither the FAQ, nor the "Efficiency Guide" that it links to,
>> actually answers Joel's question. The lack of any explicit statement
>> about a receive queue limit might be inferred to mean that there is
>> no limit other than heap sizes, but I wouldn't be sure of that
>> without looking at the implementation.
> Maybe this is seen as rather basic for the FAQ (FAQs are normally
> written by people who have forgotten the process of learning..).
More specifically, by people who are already too familiar with the
system that the FAQ is about. That's understandable, but it means that
a conscious effort should be taken not to simply dismiss questions as
"too basic" or easily answered by Google, if they are not. (This is
intended as constructive criticism.)
> It is explained very nicely in the chapter on Inter Process
> Communication in the Erlang book (p69)
Maybe I'm being dense, but this does not seem to me to be either basic,
or explained by p69 of the Erlang book. The most relevant paragraph of
the latter says:
# Erlang has a selective receive mechanism, thus no message arriving
# unexpectedly at a process can block other messages to that process.
# However, as any messages not matched by receive are left in the
# mailbox, it is the programmer's responsibility to make sure that the
# system does not fill up with such messages.
This says that the programmer should ensure that a message queue does
not "fill up". It doesn't say whether "filling up" would occur only as
a result of heap limits, or whether it could occur at some smaller,
implementation-dependent limit. (It also doesn't say whether it is
only the recipient's heap that can act as the limit, or what happens
if the recipient's heap is exhausted asynchronously.)
There are other asynchronous message passing systems representing each
of these possibilities, so it's not obvious.
Hmm, the "Erlang specification" pointed to by the FAQ seems to be
the "Erlang 4.7.3 Reference Manual, DRAFT (0.7)" dated February 1999.
Is this really the most up-to-date written specification of Erlang?
Anyway, this specification doesn't appear (by skimming section 10) to
say whether there are, or are required not to be any limits (besides
heap size) on message queue length.
David Hopwood <>
More information about the erlang-questions