sigchld vs. os.popen, os.command, etc.

Quinn Dunkan quinn at hedono.ugcs.caltech.edu
Tue Mar 7 20:54:50 EST 2000


On Tue, 07 Mar 2000 22:21:16 +0100, Niels Diepeveen <niels at endea.demon.nl>
wrote:
>Donn Cave schreef:
>
>> It's too bad select() can't wait for processes along with I/O, that
>> would be a nice solution in some cases.
>
>What if you pass the write end of an unused pipe to the child process?
>When the child terminates it will be closed and select() will return
>ready on the read end. At least that is what I would expect.

Hmm, that's a clever idea, but I wound up polling with waitpid + WNOHANG,
which seems simpler and more synchronous anyway (and fits nicely into a 15-sec
event loop).

Hmm, I wonder why we can't just have a waitpid()-like call with a timeout and
multiple pids...  I guess you could set an alarm and waitpid(-1) or
something...



More information about the Python-list mailing list