This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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:47nh2setrecipients: + nh2, georg.brandl, exarkun, Rhamphoryncus, pitrou, movement, ross, bamby, laca, mstepnicki, BreamoreBoy
2010-11-22 15:32:47nh2setmessageid: <1290439967.9.0.942957453512.issue1975@psf.upfronthosting.co.za>
2010-11-22 15:32:43nh2linkissue1975 messages
2010-11-22 15:32:42nh2create