<div>Cool, thanks!</div><div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><br>It is very easy:<br>
<br>
<br>
call(Process, CallArgs) -><br>
case process_info(Process, message_queue_len) of<br>
{message_queue_len, Len} when Len < 1000 -><br>
gen_server:call(Process, CallArgs, 20000);<br>
{message_queue_len, _} -><br>
{error, overloaded};<br>
_ -><br>
{error, noproc}<br>
end.<br>
<br>
<br>
This is not a production code and it can ruin performance on a<br>
multicore machine if many threads are trying to read<br>
message_queue_len.<br>
But somewhere we use something like this.<br>
</blockquote></div></div>