[erlang-questions] enif_send backpressure

Roger Lipscombe roger@REDACTED
Thu May 25 14:20:38 CEST 2017


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.).

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

I'm calling it from a background thread in my NIF, and it'd be nice if it
(e.g.) returned the size of the recipient's message queue, so that I could
implement backpressure in my NIF.

Any ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170525/8de732cd/attachment.htm>


More information about the erlang-questions mailing list