nh2 <n...@deditus.de> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1975>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to