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

Donn Cave donn at u.washington.edu
Tue Mar 7 12:00:21 EST 2000


Quoth quinn at mono.ugcs.caltech.edu (Quinn Dunkan):
| Ok, I know this is more of a general unix question, but when I set a handler
| for sigchld, it causes any library function which makes a child and wants to
| wiat() on it throw an IOError because my handler has already wait()ed.  Is
| there any better solution than simply wrapping all such calls in try: ...
| except IOError: pass ?

It's up to you, but in my opinion, where possible it's better to avoid
the problem and not set a handler for SIGCHLD.  The signal handling may
interrupt other things, besides wait();  even if it's not doing that right
now, it may start when you move to another platform (or later release of
the same OS or library), or when your design changes with respect to I/O
or threading.

It's too bad select() can't wait for processes along with I/O, that
would be a nice solution in some cases.  If I remember it right, VMS
has this covered, maybe what we need is GNU VMS.

	Donn Cave, donn at u.washington.edu



More information about the Python-list mailing list