[erlang-questions] enif_send backpressure
Thu May 25 18:57:20 CEST 2017
Re: name, when in doubt, just add “_ex” suffix :)
> 25 мая 2017 г., в 15:44, Roger Lipscombe <roger@REDACTED> написал(а):
> On 25 May 2017 at 13:20, Roger Lipscombe <roger@REDACTED <mailto: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 source.
> 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?
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions