RE: OT: fork(): parent or child should run first?

David Schwartz
2006-01-12T01:34:31Z

> Yes.
> But ATM the signal handler calls waitpid() and stores the pid in a
> to-be-cleaned-pids array (at time X).
> The main loop at some time in the future (say at time X+N) walks through
> the to-be-cleaned-pids array and cleans them from the active-childs
> array.

Obviously that's broken. You would have precisely the same problem if you
did the same thing with file descriptors or sockets.

DS