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

code wiget codewiget95@REDACTED
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 <dmytro.lytovchenko@REDACTED> 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 <roger@REDACTED <mailto:roger@REDACTED>>:
> On 16 August 2017 at 14:53, code wiget <codewiget95@REDACTED <mailto:codewiget95@REDACTED>> 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
> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions <http://erlang.org/mailman/listinfo/erlang-questions>
> _______________________________________________
> 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/17daa971/attachment.htm>

More information about the erlang-questions mailing list