[erlang-questions] enif_send from a thread after NIF returns

Rapsey <>
Tue Oct 26 15:41:50 CEST 2010


On Tue, Oct 26, 2010 at 3:32 PM, Joel Reymont <> wrote:

>
> On Oct 26, 2010, at 2:29 PM, Rapsey wrote:
>
> > I launch it in the load function of the nif (that gets called
> automatically). I don't join it anywhere.
>
> What I'm trying to point out is that if you do this from a function and
> don't join then you'll crash the VM very quickly.
>
> I don't understand why and how it works in your case. My guess is that
> unload is never called and thus no join is called for. Again, the docs state
> that detached threads are impossible and joining is a must.
>

Oh sorry, just noticed (it's been a while since I've implemented this). I
join the thread in unload function.


Sergej


More information about the erlang-questions mailing list