Patch Package OTP 24.0.6 Released

Max Lapshin max.lapshin@REDACTED
Sat Sep 4 09:24:56 CEST 2021


It is very easy:


call(Process, CallArgs) ->
   case process_info(Process, message_queue_len) of
     {message_queue_len, Len} when Len < 1000 ->
         gen_server:call(Process, CallArgs, 20000);
     {message_queue_len, _} ->
         {error, overloaded};
     _ ->
         {error, noproc}
 end.


This is not a production code and it can ruin performance on a
multicore machine if many threads are trying to read
message_queue_len.
But somewhere we use something like this.


More information about the erlang-questions mailing list