[erlang-questions] Questions about processes and message queues

Elias Torres <>
Tue Feb 3 17:35:25 CET 2009


I'm not an Erlang expert and don't know if there are built-in
mechanisms for limiting a process' inbox. But like with everything
else, machines have limits (disk, memory, etc) so you have to decide
what to do during failure. For example, you could decide on a timer to
shed load by flushing your inbox instead of never catching up.

Here's the basic snippet for flushing your inbox.

flush() ->
	receive
		Any ->
			flush()
	after
		0 ->
			true
	end.

Of course, you could forward those messages to another process or
machine for load sharing.

-Elias

2009/2/3 Nicola Lugato <>:
> Hello!
> i have some doubt about processes and message queues.
> What does happend if a fast process keeps sending messages to a slow
> process? Does the queue keeps growing arbitrarly or is there some kind of
> limiting mechanism ? If so, how does it work exacly?
>
> Thanks
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list