Message113104
Upon os.fork(), pending signals are inherited by the child process. This can be demonstrated by pressing C-c in the middle of the
following program:
"""
import os, sys, time, threading
def do_fork():
while True:
if not os.fork():
print 'hello from child'
sys.exit(0)
time.sleep(0.5)
t = threading.Thread(target=do_fork)
t.start()
t.join()
"""
Right after os.fork(), each child will raise a KeyboardInterrupt exception.
This behavior is different from the semantics of POSIX fork(), where child processes do not inherit their parents' pending signals.
Attached is a first stab at a patch to fix this issue. Please let me know what you think! |
|
Date |
User |
Action |
Args |
2010-08-06 14:43:15 | gdb | set | recipients:
+ gdb |
2010-08-06 14:43:15 | gdb | set | messageid: <1281105795.17.0.408658965128.issue9535@psf.upfronthosting.co.za> |
2010-08-06 14:43:13 | gdb | link | issue9535 messages |
2010-08-06 14:43:13 | gdb | create | |
|