Re: Implications of setting SIGCHLD in relation to NIFs

Lukas Larsson <[email protected]>
Newsgroups gmane.comp.lang.erlang.general
Message-ID <CAP3zBqPBc-PLsLBggy-tyAQ66PaNB53qiYqpW+vb5fx5Lq_86A@mail.gmail.com>
On Mon, Nov 16, 2020 at 10:02 PM José Valim <[email protected]> wrote:

> I see, thanks Lukas!
>
> Two follow up questions (please consider that I am not well versed in C):
>
> 1. Is there another option we could use instead of waitpid, in case we try
> to patch upstream?
>
>
I didn't read their code very thoroughly before and it seems like they call
waitpid with a given pid and not -1 as I assumed, so it may be that their
code is safe. I don't know of any better alternative.

2. Instead of ignoring, could Erlang install a handler that removes the
> zombie processes once invoked?
>
>
We could, but if I remember correctly we would still have to do multiple
waitpid(-1) calls which could end up breaking exactly what tensorflow is
doing there, but maybe the WIFEXITED call takes care of that. It was a long
time since I had to figure out all of these things and I don't remember the
details of how all this works together on all platforms.


>
>
> --
>
>
> *José Valimhttps://dashbit.co/ <https://dashbit.co/>*
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.