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

From: David Schwartz
Date: Wed Jan 11 2006 - 20:33:20 EST




> 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


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/