[erlang-questions] performance vs msg queue length

David Mercer <>
Tue Apr 20 17:00:14 CEST 2010


On Tuesday, April 20, 2010, Ulf Wiger wrote:

> One of the things being debated is how much rope should be given
> to the programmers, that they may hang themselves with. One great
> advantage of having the compiler do it internally is that it
> would only do so if in cases where it is absolutely safe to do
> so.
> 
> I think the pattern would work in most, but not necessarily all,
> of the places where selective receive is required. For the
> remaining cases, I'm not convinced - off the top of my head -
> that an explicit mark_queue() function would help either
> (but that's from spending 10 seconds thinking about it, so I
> may well be wrong.)

Unfortunately, my spot-check of about 30 selective receives within the OTP
library indicates that a receive after an erlang:monitor is the exception
rather than the rule.  I may have just been unlucky, and I'm sure ROK could
put his code-scanner to work to tell us exactly how often it occurs.

Cheers,

DBM



More information about the erlang-questions mailing list