[erlang-questions] Proper way to run C code without crashing the VM

code wiget <>
Wed Aug 16 17:11:01 CEST 2017


That is an interesting note about running it on another node and using it to communicate. For this though, I would then have to monitor when/if the node goes down as well .
> On Aug 16, 2017, at 11:07 AM, Dmytro Lytovchenko <> wrote:
> 
> Just an assumption, possibly a false assumption.
> If they already have a NIF, it means networked communication would possibly be slower than they expect.
> 
> 2017-08-16 17:05 GMT+02:00 Roger Lipscombe < <mailto:>>:
> On 16 August 2017 at 14:53, code wiget < <mailto:>> wrote:
> > I have been reading about NIF’s here:
> > http://erlang.org/doc/tutorial/nif.html <http://erlang.org/doc/tutorial/nif.html> but it seems like they are
> > incredibly unsafe: “it is also the least safe, because a crash in a NIF
> > brings the emulator down too”.
> 
> They're not "incredibly unsafe". There's nothing inherently unstable
> about a NIF. It's precisely as stable (or unstable) as the underlying
> implementation. It's just that it's running inside the BEAM, which
> means that *if* it crashes, it's going to crash the whole Erlang node.
> 
> So: if you think you can write reliable C, go for it. If not, then you
> need to look at other options. See Dmytro's email. He skipped "C Node"
> as an option, incidentally. Another option is to host the NIF in
> another Erlang node, and use Erlang distribution to talk to it.
> _______________________________________________
> erlang-questions mailing list
>  <mailto:>
> http://erlang.org/mailman/listinfo/erlang-questions <http://erlang.org/mailman/listinfo/erlang-questions>
> 
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170816/17daa971/attachment.html>


More information about the erlang-questions mailing list