Message122137
| Author |
nh2 |
| Recipients |
BreamoreBoy, Rhamphoryncus, bamby, exarkun, georg.brandl, laca, movement, mstepnicki, nh2, pitrou, ross |
| Date |
2010年11月22日.15:32:42 |
| SpamBayes Score |
6.579684e-10 |
| Marked as misclassified |
No |
| Message-id |
<1290439967.9.0.942957453512.issue1975@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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. |
|
History
|
|---|
| 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 |
|