[issue16560] Python sighandlers delayed for no reason

2012-11-26 Thread Zdenek Pavlas
New submission from Zdenek Pavlas: Quoting from signal module docs: # Although Python signal handlers are called asynchronously as far as the Python user is concerned, they can only occur between the “atomic” instructions of the Python interpreter. Yes, that's reasonable. # This means

[issue16560] Python sighandlers delayed for no reason

2012-11-27 Thread Zdenek Pavlas
Zdenek Pavlas added the comment: This patch isn't safe Yes, it's broken. Does not work unless thread support was enabled, and locking initialized. There are probably other bugs, too. Not meant to be included, really. But IMO the correct implementation should work along these lines

[issue16560] Python sighandlers delayed for no reason

2012-11-27 Thread Zdenek Pavlas
Zdenek Pavlas added the comment: for example, if you call malloc() from within a signal handler, you can get a deadlock or a crash if the signal was received while the process was in the middle of an malloc() call. Thanks, I see the problem. malloc() implements locking (when threads