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

Dmytro Lytovchenko dmytro.lytovchenko@REDACTED
Wed Aug 16 17:07:42 CEST 2017


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 <roger@REDACTED>:

> On 16 August 2017 at 14:53, code wiget <codewiget95@REDACTED> wrote:
> > I have been reading about NIF’s here:
> > 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
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170816/cf46feb2/attachment.htm>


More information about the erlang-questions mailing list