[erlang-questions] Selective receive optimization for NIFs
Mon Jul 9 11:30:47 CEST 2012
The OTP-8623 selective receive optimization was achieved partly with static code analysis done by the Erlang compiler.
In your case the NIF is creating the ref. To do the same optimization for that, would need some sort of dynamic analysis done in runtime.
Paul Davis wrote:
> I've got a bit of a curious question in relation to OTP-8623 (which is
> the selective receive for a newly created ref skips messages in the
> inbox). Apparently this doesn't appear to apply to messages generated
> from NIFs. Or at least, not in the code I've got.
> I did spend some time trawling around erts internals but the few
> references I found weren't enough for the whole thing to click. I'll
> paste the sample test code I've been using in case I'm doing something
> supremely silly.
> Paul Davis
> erlang-questions mailing list
More information about the erlang-questions