Message122137
My problem was actually related to the subprocess.Popen I use inside my threads in combination with signals. As Popen does not spawn a new thread, but a new process, it completely ignores my locks.
However, it seems impossible to safely unregister signals for subprocesses. I tried using SIG_IGN in preexec_fn for Popen as well as a ignore/Popen/unignore wrapper, but both result in race conditions (for the first: if the signal arrives between fork and exec and for the second if it arrives within the wrapper).
I think ignoring signals by default for everything but the main thread or process would solve this problem and make parallel programming with events in Python a lot easier.
Explicit is better than implicit. |
|
Date |
User |
Action |
Args |
2010-11-22 15:32:47 | nh2 | set | recipients:
+ nh2, georg.brandl, exarkun, Rhamphoryncus, pitrou, movement, ross, bamby, laca, mstepnicki, BreamoreBoy |
2010-11-22 15:32:47 | nh2 | set | messageid: <1290439967.9.0.942957453512.issue1975@psf.upfronthosting.co.za> |
2010-11-22 15:32:43 | nh2 | link | issue1975 messages |
2010-11-22 15:32:42 | nh2 | create | |
|