Btw, here are the default signal handlers registered by CPython 2.6:
* SIGINT; but it just causes KeyboardInterrupt to be raised. Even if there are multiple threads I'm fairly sure this will always cause KeyboardInterrupt to be raised in whichever thread received the signal, so IO in other threads should be safe?
* SIGPIPE, SIGXFSZ, SIGXFZ: set to SIG_IGN, so is harmless. (Even though Python calls siginterrupt(SIGPIPE, 1) after setting it to SIG_IGN, no EINTR occurs during a blocked os.read when a SIGPIPE arrives. Maybe POSIX platforms other than Ubuntu behave differently in this case, but hopefully not.)
So I think we don't need to worry about these. Phew!
Btw, here are the default signal handlers registered by CPython 2.6:
* SIGINT; but it just causes KeyboardInterrupt to be raised. Even if there are multiple threads I'm fairly sure this will always cause KeyboardInterrupt to be raised in whichever thread received the signal, so IO in other threads should be safe? SIGPIPE, 1) after setting it to SIG_IGN, no EINTR occurs during a blocked os.read when a SIGPIPE arrives. Maybe POSIX platforms other than Ubuntu behave differently in this case, but hopefully not.)
* SIGPIPE, SIGXFSZ, SIGXFZ: set to SIG_IGN, so is harmless. (Even though Python calls siginterrupt(
So I think we don't need to worry about these. Phew!