Implications of setting SIGCHLD in relation to NIFs

Lukas Larsson lukas@REDACTED
Tue Nov 17 16:21:19 CET 2020


On Mon, Nov 16, 2020 at 10:02 PM José Valim <jose.valim@REDACTED> 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/>*
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20201117/2f3371b4/attachment.htm>


More information about the erlang-questions mailing list