[erlang-questions] enif_send backpressure

Roger Lipscombe roger@REDACTED
Thu May 25 14:44:42 CEST 2017

On 25 May 2017 at 13:20, Roger Lipscombe <roger@REDACTED> wrote:

> It's my understanding that if a normal Erlang process does Pid ! Msg, and
> Pid has a particularly full message queue, then the sending process is
> penalised (gives up the remainder of its timeslice, e.g.).

I found the relevant code. Search for erts_use_sender_punish in the OTP

Is there any way to implement something similar for enif_send from a NIF?

Note that enif_send calls erts_queue_message, which *does* return the
recipient's queue length (afaict). It's just that enif_send discards the
result. Would a PR which implemented (e.g.) enif_send_return_len -- naming
is hard, suggestions appreciated -- be considered for OTP 20.x?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170525/bc0e2404/attachment.htm>

More information about the erlang-questions mailing list